It compiled, but- - -
hello,
i have the ByteTest.java file located on my harddrive at
C:\javasrc\wrox\ByteTest.java . i compiled the program and i received a class file at this same location. but when i run
the command java javasrc\wrox\ByteTest i get the error message:
Exception in thread "main" java.lang.NoClassDefFoundError: wrox\ByteTest (wrong
name: ByteTest)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknow n Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
i have tried other java programs at this same location and they run fine. i hava also tried putting in -cp -ea but i am a little unfamiliar with these. it looked like
java -cp -ea . javasrc\wrox\ByteTest
also tried
java -cp -ea . javasrc.wrox.ByteTest
just can not get this to work
thanks for the help
craig
|