Could not find the main class Program will exit [How to Solve]

At first, you may think it’s an inexplicable error, because there is no problem with the code at all, but it’s depressing to always report this error during running
the reason for the error of “could not find the main class. Program will exit” and “Java. Lang. unsupported classversionerror” is that we use the Java class file compiled by the higher version of JDK to try to run on the lower version of JVM, and the error is reported<

“could not find the main class. Program will exit.”
I just installed the latest available eclipse Version (3.2 milestone 5) and could’t run my ant builds any more. The error I got in the alert box was “could not find the main class. Program will exit”

root cause analysis: the javaw version in the open mode may be too low. For example, JDK1.5 compiled class file with 1.4 javaw open will appear this problem

solution 1 : control panel – > Folder Options – > File type – > Under Jar < Advanced > Button
< Operation > Next, select open and click < on the right; Edit >, Modify the javaw path, such as “C:// program files/Java/jdk1.5.0″_ Solution 2 : there is another case:

variable matching… (more…)

just two are enough (or one…)

java_ HOME=D:\jdk1.6
PATH=%JAVA_ HOME%\bin;<

it should be OK
and your bin directory must be in the following D: JDK1.6
if there are other directories, then add… E.g. D: JDK1.6

Similar Posts: