| Author |
Weird message when running class file
|
Logan Knecht
Greenhorn
Joined: Jun 05, 2008
Posts: 16
|
|
I just installed the SDK and was trying to run a hellworld.class file that was compiled by javac, but when I do java helloworld.class in the correct directory it gives me this. C:\Documents and Settings\Work\Desktop>java helloworld.class Exception in thread "main" java.lang.NoClassDefFoundError: helloworld/class Caused by: java.lang.ClassNotFoundException: helloworld.class 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) at java.lang.ClassLoader.loadClassInternal(Unknown Source) Does anyone know what the problem is or how to fix it?
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26192
|
|
Logan, Welcome to JavaRanch! The correct command is "java helloworld". The .class is not part of the command.
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
Logan Knecht
Greenhorn
Joined: Jun 05, 2008
Posts: 16
|
|
|
Haha oops, thank you very much.
|
 |
 |
|
|
subject: Weird message when running class file
|
|
|