Re: ClassNotfoundException
Show us the very first line of your source code; I bet your class is stored in a package while you don't know how packages are handled by the JVM.
kind regards,
Jos
Re: ClassNotfoundException
Jos, Its a simple hello world program! Just seven lines! :( Do you think I should set my path variables?
Re: ClassNotfoundException
This is what I get everytime I try to run a program on the console.
D:\Program Files (x86)\Java\jdk1.6.0_21\bin>java ex
Exception in thread "main" java.lang.NoClassDefFoundError: ex
Caused by: java.lang.ClassNotFoundException: ex
at java.net.URLClassLoader$1.run(URLClassLoader.java: 202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 07)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 48)
Could not find the main class: ex. Program will exit.
Re: ClassNotfoundException
Quote:
Originally Posted by
shirleympearls
This is what I get everytime I try to run a program on the console.
D:\Program Files (x86)\Java\jdk1.6.0_21\bin>java ex
Exception in thread "main" java.lang.NoClassDefFoundError: ex
Check if a file ex.class exists in the directory where you want to run it. (funny name "ex", I would've expected something like HelloWorld or similar).
kind regards.
Jos