B
boltar2003
Hi
I'm just starting to teach myself java and as such I've installed the
latest jre1.6 and jdk1.6 for Linux from Suns website into /usr/local. I've
set my PATH to point to /usr/local/jre1.6.0_16/bin, /usr/local/jre1.6.0_16,
/usr/local/jdk1.6.0_16/bin and /usr/local/jdk1.6.0_16/. Also I've set
my CLASSPATH to point to /usr/local/jre1.6.0_16/lib:.
Compiling my test programs works fine, however when I run my simple hello
world program I get the following:
tantallon$ java hello.java
Exception in thread "main" java.lang.NoClassDefFoundError: hello/java
Caused by: java.lang.ClassNotFoundException: hello.java
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)
Could not find the main class: hello.java. Program will exit.
Can someone tell me what I need to do to fix this as the answers google
brings up all seem to point to a wrong CLASSPATH but that doesn't seem to
fix this error.
Thanks for any help
B2003
I'm just starting to teach myself java and as such I've installed the
latest jre1.6 and jdk1.6 for Linux from Suns website into /usr/local. I've
set my PATH to point to /usr/local/jre1.6.0_16/bin, /usr/local/jre1.6.0_16,
/usr/local/jdk1.6.0_16/bin and /usr/local/jdk1.6.0_16/. Also I've set
my CLASSPATH to point to /usr/local/jre1.6.0_16/lib:.
Compiling my test programs works fine, however when I run my simple hello
world program I get the following:
tantallon$ java hello.java
Exception in thread "main" java.lang.NoClassDefFoundError: hello/java
Caused by: java.lang.ClassNotFoundException: hello.java
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)
Could not find the main class: hello.java. Program will exit.
Can someone tell me what I need to do to fix this as the answers google
brings up all seem to point to a wrong CLASSPATH but that doesn't seem to
fix this error.
Thanks for any help
B2003