Saturday, May 22, 2010

Error Executing Java Program. 10 POINTS for the first person who gives the correct solution!?

javac example.java





no problems





java example





exception in thread "main" java.lang.noclassfounderror: example





i went to environment variables


and add


C:\Program Files\Java\jdk1.6.0\bin;


C:\Program Files\Java\jdk1.6.0\jre\lib\rt.jar;





still the problem prevails...





i went to start-%26gt;run-%26gt;sysedit





i saw nothin related to java there ...





what is the problem?

Error Executing Java Program. 10 POINTS for the first person who gives the correct solution!?
Do you have other classes? are they in the same directory?





Sounds to me like there is some class in your code that you are using that it cant find.
Reply:Before compiling you need to set the path to the bin folder. for example:





c:/SETPATH="c:/jdk1.6/bin"





Also make sure you have the latest version of java installed. Otherwise download java sdk from http://java.sun.com
Reply:Sounds like you have a CLASSPATH issue. Does your project include any jars?





Doesn't sound like you have a PATH variable problem as you can already execute javac and java.


No comments:

Post a Comment