This is the fourth day of my participation in Gwen Challenge.
Hello, I’m Grey Ape! A super bug writing program ape!
Today we’re not going to write bugs, we’re going to solve bugs.
Write so many bugs, someone has to fix it!!
Later, I will continue to update the various difficulties encountered in Java development in this column to help friends solve bugs faster!
Junit unit test junit unit test junit unit test junit unit test junit unit test junit unit test junit unit test
Unsupported major, minor version 51.0
Pro version 51.0 is not supported
You are using the wrong version of something, so the system does not support it.
At that time was very confused, after baidu to find relevant solutions, for the solution of this bug is quite a lot. But a lot of it is just plain ugly, a lot of it is long and it doesn’t solve the problem.
Later, after careful study, we found that the cause of this bug is: the JDK version of your project is different from the JDK version of your computer. The error I reported above is 51, which corresponds to JDK1.7 version, indicating that my computer does not support the VERSION OF JDK1.7 used in my current project.
Here is the CORRESPONDING JDK version of the response number:
- J2SE 8 = 52,
- J2SE 7 (jdk1.7) = 51,
- J2SE 6.0 (jdk1.6) = 50,
- J2SE 5.0 (jdk1.5) = 49,
- JDK 1.4 = 48,
- JDK 1.3 = 47,
- JDK 1.2 = 46,
- JDK 1.1 = 45
So what?
Easy to do, the project project JDK version to change not on the line.
Here are the steps:
1. Right click on your project and select Preference at the bottom, then in the dialog box that pops up find: Java Compiler,
Compiler Compilance level (JDK version number)
I just opened it here, because I reported the error parameter is 51, which corresponds to JDK1.7, so you can see the yellow error reminder below.
3. Now THAT I have lowered the version number to 1.6, there is no error notification, indicating that it is ok now!
4. After clicking OK, a prompt box will appear. Click Yes.
Now run the code again, and the problem is almost fixed!
If you have a problem or can’t solve it, or have other solutions, please leave a message in the comment section!
I’m grey Ape! See you next time!