Home >Java >javaTutorial >Java \'UnsupportedClassVersionError\': Why Can\'t My Program Run with JDK 7?
Question: I've installed JDK7, but when I run a simple Java program, I receive an "UnsupportedClassVersionError". How can I resolve this?
Answer:
This error indicates a mismatch between the Java version your program was compiled for and the version you're attempting to run it with. To resolve this:
Set Java Version: If multiple Java versions are installed, you may need to explicitly set which version to use by editing the $JAVA_HOME environment variable or using sudo update-alternatives --config java to select the desired version.
The above is the detailed content of Java \'UnsupportedClassVersionError\': Why Can\'t My Program Run with JDK 7?. For more information, please follow other related articles on the PHP Chinese website!