Tuesday, 16 May 2017

jvm - How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version

I am trying to use Notepad++ as my all-in-one tool edit, run, compile, etc.



I have JRE installed, and I have setup my path variable to the .../bin directory.



When I run my "Hello world" in Notepad++, I get this message:



java.lang.UnsupportedClassVersionError: test_hello_world :
Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClassCond(Unknown Source)
.........................................


I think the problem here is about versions; some versions of Java may be old or too new.




  1. How do I fix it?

  2. Should I install the JDK, and setup my path variable to the JDK instead of JRE?

  3. What is the difference between the PATH variable in JRE or JDK?


No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...