Today in the CMD environment
java Helloworld.java
javac Helloworld
If it doesn’t work, it shows up
Exception in thread "main" java.lang.UnsupportedClassVersionError: helloworld has been compiled by a more recent version of the Java Runtime (class file version 57.0), this version of the Java Runtime only recognizes class file versions up to 52.0
Error message.
after thinking about it, I probably made a java8 environment by playing mine craft before. Later, I downloaded and installed jdk13 for development, which caused the problems caused by the difference between javac and Java version.
then reset JAVA_HOME to C:\Program Files\Java\jdk-13
should be solved.
when something weird happens, still report this error. In a rage, I deleted
and reported an error after I deleted
directory which caused the conflict
Error: could not open `C:\Program Files\Java\jre1.8.0_201\lib\amd64\jvm.cfg
The problem should be clear, because I don’t know which environment variable is still pointing to this folder, I find the same problem in stackoverflow, where Jason Hughes mentioned that this guideline exists in C:\Program Files\Common Files\oracle\
folder, (my word is C:\Program Files(x86)\Common Files\oracle\
), delete the directory directly and restart once it comes.
problem solved.