I've been having
Exception in thread "main" java.lang.UnsupportedClassVersionError: Unsupported major.minor version 51.0
So I looked it up, and then updated both my JRE and JDK to 8th version.
But above the console, it displays:
System/Library/Java/JavaVirtualMachines/1.6.0 JDK ....
How do I make my Eclipse run in 8th version of JDK and JRE? And do I need to change anything in my projects after upgrading?
Thanks in advance!
In Eclipse:
Note: If your projects don't use the workspace default, then you need to update the project Properties.
Eclipse itself is running with the default Java, ie the java on your PATH
. If you want Eclipse to run using a different JDK/JRE, you need to edit the eclipse.ini
file. See the link provided by Tarun Gupta.
Check for:
1) Proper java environment variable setup.
2) Right click on Project name in Project Explorer in Eclipse.
Click on Build Path
-> Configure Build Path
.
Check for proper path for Java Build Path . Also check whether the latest version of Java is selected in Java Compiler
-> Compiler Compliance Level
.
3) Check from command line which Java is installed by typing java -version
or java
.
(Sometimes Java installed from command line in Linux systems installs old versions)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.