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:
- SDK manager cannot open the solution (Android)
- JAVA Command Error: A JNI error has occurred, please check your installation and try again [Solved]
- The Java – jar *. Jar prompt in CMD is unable to access jarfile *. Jar or windows can’t double-click to run jar file. What should I do
- Git clone error not found [How to Solve]
- [Solved] JAVA Run Error: Error: Could not find or load main class
- Eclipse can’t open, prompt could not open jvm.cfg error
- [Solved] NB: JAVA_HOME should point to a JDK not a JRE
- The problem of JUnit test report class not found in maven
- [Solved] STS Error: could not find tools.jar in the active JRE
- Android Studio Emulator: PANIC: Cannot find AVD system path. Please define ANDROID_SDK_ROOT (Solved)