classfile has wrong name WRT package?



Here 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
6 Dir(s) 786,223,104 bytes free

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.HelloWorldApp" />
</manifest>
</jar>
</target>











</project>

C:\java>
C:\java>cd src

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

Directory of C:\java\src

06/24/2006 10:34p <DIR> .
06/24/2006 10:34p <DIR> ..
06/24/2006 11:05p <DIR> thufir
0 File(s) 0 bytes
3 Dir(s) 785,772,544 bytes free

C:\java\src>cd thufir

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

Directory of C:\java\src\thufir

06/24/2006 11:05p <DIR> .
06/24/2006 11:05p <DIR> ..
06/24/2006 09:58p <DIR> bonjour
0 File(s) 0 bytes
3 Dir(s) 785,772,544 bytes free

C:\java\src\thufir>cd bonjour

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

Directory of C:\java\src\thufir\bonjour

06/24/2006 09:58p <DIR> .
06/24/2006 09:58p <DIR> ..
06/24/2006 11:04p 306 HelloWorldApp.java
1 File(s) 306 bytes
2 Dir(s) 785,772,544 bytes free

C:\java\src\thufir\bonjour>type HelloWorldApp.java
package thufir.bonjour;



/**
* The HelloWorldApp class implements an application that
* simply displays "Hello World!" to the standard output.
*/
class HelloWorldApp {
public static void main(String[] args) {
System.out.println("Hello World!"); //Display the string.
}
}

C:\java\src\thufir\bonjour>
C:\java\src\thufir\bonjour>javac HelloWorldApp.java

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

Directory of C:\java\src\thufir\bonjour

06/24/2006 11:21p <DIR> .
06/24/2006 11:21p <DIR> ..
06/24/2006 11:21p 447 HelloWorldApp.class
06/24/2006 11:04p 306 HelloWorldApp.java
2 File(s) 753 bytes
2 Dir(s) 785,772,544 bytes free

C:\java\src\thufir\bonjour>java HelloWorldApp
Exception in thread "main" java.lang.NoClassDefFoundError:
HelloWorldApp (wrong name: thufir/bonjour/HelloWorldApp)
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\src\thufir\bonjour>echo "err, bog."
"err, bog."

C:\java\src\thufir\bonjour>


The HelloWorldApp.java source file says that it's in package
thufir.bonjour, which is reflected by its path. So that's
correct, yes?

When compiled, HelloWorldApp.class ends up at
C:\java\build\prod\thufir\bonjour which is also correct. Yes?

The name of the source file, the directory structure and
the package names match, so I'm not understanding what
"doesn't have the right name."


thanks,

Thufir

.



Relevant Pages

  • Re: So who makes money in the specialty coffee business???
    ... The federal government has labeling requirements for goods ... package. ... A company may want to add additional material to their label such as ... there can be consumer intellectual overload - just too much ...
    (alt.coffee)
  • Re: My heart is aching
    ... > I'll bet someone regifted him a crappy label maker and the label fell off ... The P.O uses machinery to process the mail. ... package, and nothing is left of a readable lable. ... I have had 2 pipes lost in the mail. ...
    (alt.smokers.pipes)
  • Re: Whats Up With USPS Delivery Confirmation?
    ... If you print your label thru PP it may or may not - to be sure take it ... to a window and make sure they scan it - they ARE NOT REQUIRED to - ... You can request package pickup (if you have at least one ... This is WAY too much information, though, for many buyers. ...
    (alt.marketing.online.ebay)
  • Re: Paypal shipping labels Email Confirm??
    ... and you get to add a note to it in the first PP label ... Your package will be shipped by PayPal Shipping with U.S. Postal ... You can view PayPal transaction details related to this shipment at: ...
    (alt.marketing.online.ebay)
  • Could not load type
    ... In Web Developer Express I make a very simple aspx page. ... The page has a label, the label text is "Hello World". ... details and modify your source file appropriately. ... Parser Error Message: ...
    (microsoft.public.dotnet.framework.aspnet)