classfile has wrong name WRT package?

JAVA

    Sponsored Links

    Next

  • 1. String operations
    Hello. I am trying to check to see if the first 4 characters of a string match a hard-coded value. For example: If a user enters input into a textfield, I'd like to check to see if the first 4 characters are PROD, before I attempt to search the database for the item. Does java have a string function that could do this? startsWith() looks promising, but what if the string I was looking for was in the middle of the string? final String startStr="PROD"; //all names start with 'PROD' thanks. fb
  • 2. Trivial swing question about colors?
    Hi, When a JTable object is placed in a JScrollPane object, the background color of the area *below the last table row* is standard grey. Does anyone know which component one has to get to modify the color of that area. I've tried the JScrollPane and the JTable, but none of these give the desired result. Thanks, -- Luc Van Bogaert
  • 3. writing a file to hard-coded path in Mac OS X?
    I am having problems getting the file and path separators working right, so I'm looking for an example pgm for use in writing a file to a specified, arbitrary place. For example, suppose I have the following folder hierarchy on machine MyCPU: MyDrive ParentFolder ChildFolder and I want to create a File "outputfile.txt" that will be written into folder "ChildFolder". Can anyone provide an example that works? My system properties are set to path.separator =: and file.separator=/ I've tried far too many permutations and combinations of ":" and a "/" without success. What am I not getting about separators? Thanks. Bill Christens-Barry
  • 4. Jave help for intel Mac running windows
    Hello I hope I am posting to the right forum I am sorry if I am not.. I am running Windows XP home edition SP 2 on an intel Mac using Apple's bootcamp. I am trying to run an application which is not starting and is giving me the following error - "Unable to start application - the Java Virtual Machine cannot be loaded. Class not registered." I downloaded and ran a program called - MSJavWU_5_3810 but no respite. Would be grateful for any help regards Rishi

classfile has wrong name WRT package?

Postby hawat.thufir » Mon, 26 Jun 2006 16:46:35 GMT

ere I am in windows 2k:


C:\java>
C:\java>
C:\java>
C:\java>
C:\java>ant
Buildfile: build.xml

clean:
[delete] Deleting directory C:\java\build

prepare:
[mkdir] Created dir: C:\java\build\prod

compile:
[javac] Compiling 1 source file to C:\java\build\prod

package:
[jar] Building jar: C:\java\HelloWorldApp.jar

BUILD SUCCESSFUL
Total time: 49 seconds
C:\java>cd C:\java\build\prod

C:\java\build\prod>dir
Volume in drive C has no label.
Volume Serial Number is FCD2-42DE

Directory of C:\java\build\prod

06/24/2006 11:08p <DIR> .
06/24/2006 11:08p <DIR> ..
06/24/2006 11:08p <DIR> thufir
0 File(s) 0 bytes
3 Dir(s) 786,223,104 bytes free

C:\java\build\prod>cd thufir

C:\java\build\prod\thufir>dir
Volume in drive C has no label.
Volume Serial Number is FCD2-42DE

Directory of C:\java\build\prod\thufir

06/24/2006 11:08p <DIR> .
06/24/2006 11:08p <DIR> ..
06/24/2006 11:08p <DIR> bonjour
0 File(s) 0 bytes
3 Dir(s) 786,223,104 bytes free

C:\java\build\prod\thufir>cd bonjour

C:\java\build\prod\thufir\bonjour>dir
Volume in drive C has no label.
Volume Serial Number is FCD2-42DE

Directory of C:\java\build\prod\thufir\bonjour

06/24/2006 11:08p <DIR> .
06/24/2006 11:08p <DIR> ..
06/24/2006 11:08p 359 HelloWorldApp.class
1 File(s) 359 bytes
2 Dir(s) 786,223,104 bytes free

C:\java\build\prod\thufir\bonjour>java HelloWorldApp
Exception in thread "main" java.lang.NoClassDefFoundError:
HelloWorldApp (wrong name: thufir/bonjour/Hel
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

C:\java\build\prod\thufir\bonjour>cd C:\java

C:\java>dir
Volume in drive C has no label.
Volume Serial Number is FCD2-42DE

Directory of C:\java

06/24/2006 11:07p <DIR> .
06/24/2006 11:07p <DIR> ..
06/24/2006 11:07p <DIR> build
06/19/2006 03:25p 677 build.groovy
06/24/2006 11:07p 1,324 build.xml
06/24/2006 10:47p 1,398 build.xml.HelloWorldApp
06/24/2006 11:08p 962 HelloWorldApp.jar
06/24/2006 11:00p <DIR> META-INF
06/24/2006 10:34p <DIR> src
06/24/2006 10:05p <DIR> vendor
4 File(s) 4,361 bytes

Re: classfile has wrong name WRT package?

Postby Ed » Mon, 26 Jun 2006 18:49:01 GMT

 XXXX@XXXXX.COM  skrev:




Yes.


Yes.

You should be able run the class-file from:
C:\java\build\prod

With command:
java thufir.bonjour.HelloWorldApp

.ed

www.edmundkirwan.com


Re: classfile has wrong name WRT package?

Postby hawat.thufir » Tue, 27 Jun 2006 00:04:26 GMT


[...]
[...]

Thanks!      :)

Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

C:\>cd  C:\java\build\prod

C:\java\build\prod> java thufir.bonjour.HelloWorldApp
Hello World!

C:\java\build\prod>


I was looking at roedy's page on this error, but, well...

-Thufir


Re: classfile has wrong name WRT package?

Postby hawat.thufir » Tue, 27 Jun 2006 11:03:08 GMT

I also got the jar task working :)

However, the jarfile and Main-Class attributes are hard coded, rather
than using properties :(


+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

C:\java>
C:\java>
C:\java>ant
Buildfile: build.xml

clean:
   [delete] Deleting directory C:\java\build

prepare:
    [mkdir] Created dir: C:\java\build\prod

compile:
    [javac] Compiling 1 source file to C:\java\build\prod

package:
      [jar] Building jar: C:\java\HelloWorldApp.jar

BUILD SUCCESSFUL
Total time: 27 seconds
C:\java>dir
 Volume in drive C has no label.
 Volume Serial Number is FCD2-42DE

 Directory of C:\java

06/25/2006  05:52p      <DIR>          .
06/25/2006  05:52p      <DIR>          ..
06/25/2006  05:51p      <DIR>          build
06/19/2006  03:25p                 677 build.groovy
06/25/2006  05:51p               1,310 build.xml
06/24/2006  11:07p               1,324 build.xml.HelloWorldApp
06/25/2006  05:52p                 967 HelloWorldApp.jar
06/25/2006  05:41p      <DIR>          src
06/24/2006  10:05p      <DIR>          vendor
               4 File(s)          4,278 bytes
               5 Dir(s)     816,582,656 bytes free

C:\java>java -jar HelloWorldApp.jar
Hello World!

C:\java>type build.xml
<?xml version="1.0"?>
<!--

        Just a simple HelloWorld app

 -->

<project name="Hello" default="package" basedir=".">

        <property name="build.dir"      location="build"/>
        <property name="build.prod.dir" location="${build.dir}/prod"/>
        <property name="doc.dir"        location="doc"/>
        <property name="index.dir"      location="index"/>
        <property name="src.dir"        location="src"/>
        <property name="test.dir"       location="test"/>
        <property name="vendor.lib.dir" location="vendor/lib"/>

        <property name="pkg.dir" location="thufir.bonjour"/>
        <property name="mainClass" location="HelloWorldApp"/>

        <path id="project.classpath">
                <pathelement location="${build.prod.dir}" />
        </path>

        <target name="clean">
                <delete dir="${build.dir}" />
        </target>

        <target name="prepare" depends="clean">
                <mkdir dir="${build.prod.dir}"/>
        </target>


        <target name="compile" depends="prepare">
                <javac srcdir="${src.dir}" destdir="${build.prod.dir}">
                        <classpath refid="project.classpath" />
                </javac>
        </target>


        <target name="package" depends ="compile">
                <jar jarfile="HelloWorldApp.jar"
basedir="${build.prod.dir}" >
                        <manifest>
                                <attribute name="Main-Class"
value="thufir.bonjour.HelloWorldApp" />
                        </manifest>
                </jar>
        </target>
</project>

C:\java>
C:\java>
C:\java>
C:\java>

++++++++++++++++++++++++++++++++++++++++++++++++++++++++


-Thufir


Re: classfile has wrong name WRT package?

Postby hawat.thufir » Tue, 27 Jun 2006 11:27:30 GMT

icrosoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

C:\>cd java

C:\java>dir
Volume in drive C has no label.
Volume Serial Number is FCD2-42DE

Directory of C:\java

06/25/2006 06:20p <DIR> .
06/25/2006 06:20p <DIR> ..
06/25/2006 06:19p <DIR> build
06/19/2006 03:25p 677 build.groovy
06/25/2006 06:19p 1,291 build.xml
06/25/2006 05:51p 1,310 build.xml.HelloWorldApp
06/25/2006 05:41p <DIR> src
06/24/2006 10:05p <DIR> vendor
3 File(s) 3,278 bytes
5 Dir(s) 815,157,248 bytes free

C:\java>ant
Buildfile: build.xml

clean:
[delete] Deleting directory C:\java\build

prepare:
[mkdir] Created dir: C:\java\build\prod

compile:
[javac] Compiling 1 source file to C:\java\build\prod

package:
[jar] Building jar: C:\java\HelloWorldApp.jar

BUILD SUCCESSFUL
Total time: 31 seconds
C:\java>
C:\java>dir
Volume in drive C has no label.
Volume Serial Number is FCD2-42DE

Directory of C:\java

06/25/2006 06:21p <DIR> .
06/25/2006 06:21p <DIR> ..
06/25/2006 06:20p <DIR> build
06/19/2006 03:25p 677 build.groovy
06/25/2006 06:19p 1,291 build.xml
06/25/2006 05:51p 1,310 build.xml.HelloWorldApp
06/25/2006 06:21p 967 HelloWorldApp.jar
06/25/2006 05:41p <DIR> src
06/24/2006 10:05p <DIR> vendor
4 File(s) 4,245 bytes
5 Dir(s) 815,153,152 bytes free

C:\java>java -jar HelloWorldApp.jar
Hello World!

C:\java>type build.xml
<?xml version="1.0"?>
<!--

Just a simple HelloWorld app

-->

<project name="Hello" default="package" basedir=".">

<property name="build.dir" location="build"/>
<property name="build.prod.dir" location="${build.dir}/prod"/>
<property name="doc.dir" location="doc"/>
<property name="index.dir" location="index"/>
<property name="src.dir" location="src"/>
<property name="test.dir" location="test"/>
<property name="vendor.lib.dir" location="vendor/lib"/>

<property name="pkg" value="thufir.bonjour"/>
<property name="mainClass" value="HelloWorldApp"/>

<path id="project.classpath">
<pathelement location="${build.prod.dir}" />
</path>

<target name="clean">
<delete dir="${build.dir}" />
</target>

<target name="prepare" depends="clean">
<mkdir dir="${build.prod.dir}"/>
</target>


<target name="compile" depends="prepare">
<javac srcdir="${src.dir}" destdir="${build.prod.dir}">
<classpath refid="project.classpath" />
</javac>
</target>


<target name="package" depends ="compile">
<jar jarfile="${mainClass}.jar"
basedir="${build.prod.dir}" >
<manifest>

Similar Threads:

1.packages names are wrong

2.How to call global function having its name?

Hi!

In an app which I'm trying to fix to work with FF there's a lot of
code like eval("function_name();"). I remember that there's some way
to call global functions using window object, but I can't get it to
work. Here's what I tried (in Firebug console):

function a() {alert("a called")};
a(); // works
eval("a();"); // works
window["a"](); // doesn't work
TypeError: window.a is not a function

window.b = function() {alert("b called");}
window["b"](); // works

So how can I call global functions in other way than using eval?

Thanks in advance

3.mz js select nodes with xpath, having by specific attribute named 'class' the 'subvalue part' set

<style>
   .marek{}
</style>
etc..
<root>
<element class="marek mand"/>
<element class="mand marek blah"/>
<element class="mand marekmd"/>
<element class="mand marekk"/>
</root>

I would like to know what is the XPath expression for Mozillas 
JavaScript document.evaluate method first argument, if i want to get all 
the nodes, that have the 'css'-class named "marek" set.

By above data only 2 elements should be returned, because they and they 
only have the 'css' class "marek" set. The XPath expression should not 
match 'marekk' nor 'marekmd'.


I read few articles about xpath and i didnt saw any regular expressions 
to be used there, but what i saw was that the xpath string functions are 
definately too weak and clumsy to achieve my goal. I am new to XPath, 
smz o i thought some master regular could teach me a bit.

TIA

4.package -- what am I doing wrong?

This is a multi-part message in MIME format.

Java-ians of all levels,
Managing and importing classes is supposed to be easy using PACKAGE.  
However, I cannot make it work.  Here is a recent attempt:

the file called packageThingie.java contains

package myPackage;
public class packageThingie
{
}

the file called testMyPackage.java contains
import myPackage.*  

public class testMyPackage
{
    testMyPackage()    //default constructor
    {
    }    //closes constructor

    public static void main(String args[])
    {
        testMyPackage myTMP = new testMyPackage();
    }
}

When I compile, I keep getting a message saying the package myPackage 
doesn't exist.  FYI, both .java files and their corresponding .class 
files are in the C:\j2sdk1.4.1\bin directory.

HELP!!

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
  <title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<title></title>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<title></title>
Java-ians of all levels,<br>
Managing and importing classes is supposed to be easy using PACKAGE. 
However, I cannot make it work.  Here is a recent attempt:<br>
<br>
the file called packageThingie.java contains<br>
<br>
package myPackage;<br>
public class packageThingie<br>
{<br>
}<br>
<br>
the file called testMyPackage.java contains<br>
import myPackage.*   <br>
<br>
public class testMyPackage<br>
{<br>
    testMyPackage()    //default constructor<br>
    {<br>
    }    //closes constructor<br>
<br>
    public static void main(String args[])<br>
    {<br>
        testMyPackage myTMP = new testMyPackage();<br>
    }<br>
}<br>
<br>
When I compile, I keep getting a message saying the package myPackage
doesn't exist.  FYI, both .java files and their corresponding .class
files are in the C:\j2sdk1.4.1\bin directory.<br>
<br>
HELP!!<br>
</body>
</html>

5.xdoclet facade and wrong packages for interfaces

Hi,

problem is when generating session facade for CMP bean, eg. if I have
a package

    some.package.foo.cmp.MyEJB

and my intention is to generate interfaces into

    some.package.foo.iface.MyEJBLocal
    some.package.foo.iface.MyEJBHome
    ...

still when I generate session facade for CMP, result it refers to
wrong interaface packages.

    some.package.foo.cmp.MyEJBLocal
    some.package.foo.cmp.MyEJBHome
    ...

Generator cycle is
1. generating ifaces for CMP to make sure that facade generation, that
follows finds correct iface packages.
2. generating facade for CMP
3. generationg iface for facade

How to do the trick so that facade generator refers to right interface
packages?


--kari

6. Tomcat + JSP + GUI trouble: javax.servlet.ServletException: UserData (wrong name: UserData/UserData)

7. CORBA over VPN Wrong Machine Name

8. request.getHeader("Host") returns wrong host name



Return to JAVA

 

Who is online

Users browsing this forum: No registered users and 61 guest