Reputation: 197
java - version in DOS shows the version to be
java version "1.8.0_91".
However, my code http://pastebin.com/kSZKszYy in Eclipse is showing major.minor error 52. A little research told me there was a mismatch in my code and the JDK version I am running. In windows->preferences I found out my JDK to be version 1.7.
I could not try and import 1.8 which is supposedly already present on my computer.
A step by step approach of how to import the newer version of JDK will be appreciated.
JDK version I have installed is jre-8u91-windows-x64.exe.
My Machine runs on windows 10 and has a 64 bit architecture.
I am running Eclipse Mars.
Upvotes: 1
Views: 2186
Reputation: 72636
Inside Eclipse you can easily select the JRE that you want to use for your specific project or all of your projects in your workspace through the preference pane. To change the JRE for all your projects in your workspace you can :
In the picture above you can see that I have two JREs available (1.7 and 1.8.0_92) and I choose to use the version 7 instead of the latest 1.8.
To add a JRE, you have to :
After selecting the new JRE you may need to select the compiler compliance level to the version of the new JVM you have selected, here is an example :
Upvotes: 1