View Single Post
 
Old January 6th, 2012, 07:41 AM
Nixxxter Nixxxter is offline
Registered User
Points: 20, Level: 1
Points: 20, Level: 1 Points: 20, Level: 1 Points: 20, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2011
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Compiling Java Program

Hi
I have since uninstalled the version of JRE and JDK i was using
and Installed Java (tm) SE Runtime Enviornment (Build 1.6.0_24-b07)
and JDK 1.6.0_24
to the following Directory C:\Program Files\Java.
In the JAVA Directory two sub folders exist the 1st being : jdk1.6.0_24 & jre6 ,
both have the correct \Bin Sub directories !
I also added the following value:C:\Program Files\Java\jdk1.6.0_24\bin to my Windows XP SP2 system environment variable called PATH


Also after checking the *java File where i declared the main Class
Code:
class Hello
and also checking the *name of the File to make sure that it is the same as the Class which it is, I still get the following error when trying to run the program
Exception in thread "main" java.lang.NoClassDefFoundError: Hello
Caused by: java.lang.ClassNotFoundException: Hello
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)
Could not find the main class: Hello. Program will exit.