So I got an error in eclipse saying "The compiler compliance specified is 1.8 but a JRE 15 is used", and when I try to change the Java compiler, eclipse said When selecting 1.8 compliance, make sure to have a compatible JRE installed and activated(currently 15). Configure the 'Installed JREs' and Execution Environments, or change the JRE on the Java Build Path
And when I go to the Java build path the JRE there is 1.8 instead of 15. And after that I went to Execution environments and saw JavaSE - 15 is the only one that has [perfect match] in the compatible JREs box, but if I try to add Java SE - 1.8, there is a new warning, something like Build path specifies execution environment JavaSE - 1.8, there are no JREs installed in the workspace that are strictly compatible with this environment
and after that, I have no idea what to do...
In the preferences do you see something like this - Windows->Preferences->Java->Installed JREs
Either ensure the proper JRE is there or go to the Windows->Preferences->Java->Compiler and make sure your compliance setting matches.
I have Java Maven project in my Eclipse IDE. I found strange selection of execute environment:
I'm building application for Java ver. 1.8. For this reason I have downloaded JDK1.8. What does J2SE-1.5 means there?
This generates Java code that can be executed with a Java 5 VM as long as you are using nothing from the JRE system library that was introduced after Java 5 (e. g. String#isEmpty() which requires Java 6 or higher).
To this problem points out the warning, which you will get:
The compiler compliance specified is 1.5 but a JRE 1.8 is used
For this problem, there is the compiler flag --release (Project > Properties: Java Compiler) which requires at least a Java 9 JRE/JDK and Eclipse Photon (4.8) and the selected execution environment must be at least JavaSE-1.6 and not higher than the highest available JRE/JDK (Window > Preferences: Java > Installed JREs). Which means in your case you can also install a newer JDK than the Java 8 JDK to write Java 8 code as long as you do not want to use something that has been removed from the JRE system library in the meantime.
I have set Java Compiler Compliance Level to 1.6 in Eclipse.
A coworker ran some binaries on a machine that runs only Java 6 and execution failed for Unsupported major.minor version: 51.
We do not have (yet*) an automated build/CI system: an Ant task builds a JAR from the bare bin/ directory contents compiled by Eclipse's Auto-build workspace function and not (yet*!) using javac. I only run JDK 7 on my machine, I have no trace of JDK 6.
The question is really simple: does setting compliance level affect the output binaries version or does it only block you from using types/syntaxes from the new runtimes?
*Yet means we are working on it
compliance level is for eclipse to understand language features in compiling/warning/suggesting features
You need to also set
Installed JRE to proper version of JDK (note: JDK)
installed JRE is located at
preference -> Java -> Installed JRE
As you mentioned, you have compiled the code on JDK 7 while your colleague ran it with JAVA 6 binaries. And this is the why he/she got the failure "Unsupported major.minor version: 51".
As stated by Jigar, setting compliance level simply say eclipse to adjust the warning/suggestion according to specified JDK but the code will actually be compiled with the installed JREs/JDK only.
Please install a JDK version 6 and go to preferences->JAVA->Installed JREs -> Add -> select JDK 1.6 from your machine. And clean & build your project.
This will compile your code to be able to run on JRE 6.
Hope it helps.
I'm using latest version of Eclipse Luna on Mac OS X 10.9.4. Whenever I try to open the Eclipse it says "version 1.6.0_65 of the JVM is not suitable for this product, version 1.7 or greater is required". I installed java 7 (JRE, I don't need JDK) but still I'm getting the same error. I tried java -version and the output was "java version 1.6.0_65". I can see the java icon on my system preferences. I also restarted my Mac to see if that works but that doesn't help either. I searched on google and some people suggesting other users to change Eclipse.ini file, the instructions wasn't clear and I'm a java beginner so I've no idea where and what to edit. Any step by step instructions will be appreciated.
I had this same problem with a fresh install of Eclipse Mars on OSX. I had installed the JRE from https://java.com/en/download/ (which is the top google search result for "java download" for me.
This failed for me with the same message "version 1.6.0_65 of the JVM is not suitable for this product, version 1.7 or greater is required"
Then I saw a comment that I should get the JRE/JDK from oracle instead:
http://www.oracle.com/technetwork/java/javase/downloads/index.html
After downloading the most recent JDK from Oracle Eclipse starts fine.
A potential solution to your problem might be to uninstall Java6 (provided by Apple itself) and only have Java7 installed in your system. This only applies in case you have no applications that desperately need the old Java6 version to be installed.
To remove the Apple-like Java6 installation open a Terminal and:
sudo rm -rf /System/Library/Java/JavaVirtualMachines/1.6.0.jdk
After this step you should only have Java7 by Oracle installed in your system. To verify, open another terminal and do a:
java -version
It should display something like "java version "1.7.0_XX" where XX is the current update version of the Java7 installation. If not: proceed with the next step.
Redefine the JAVA_HOME variable (to support IDEs like Eclipse and other developer tools...), which helps detecting where the "active" Java installation is situated in your system. Open a terminal and (Note: replace XX first!):
sudo rm /Library/Java/Home
sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.7.0_XX.jdk/Contents/Home /Library/Java/Home
Afterwards, a fresh installation of Eclipse should detect Java7 in your system and should work with this version out of the box. You can modify an installed Eclipse to use this installation by navigating in Eclipse to:
Preferences -> Java -> Installed JREs. Then remove the old Java6 system entry AND add new path (see above) with the name Java7.
You can modify Info.plist inside Eclipse.app (right clic on Eclipse.app --> show package contents) and specify -vm after <key>Eclipse</key>.
For example :
<key>Eclipse</key>
<array>
<string>-vm</string><string>/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home/jre/bin/java</string>
<string>-keyring</string><string>~/.eclipse_keyring</string>
<string>-showlocation</string>
</array>
Ensure you installed the jdk 7 or above. If you have a Mac you most likely have 1.6.0.jdk. To check your java development kit (jdk) version go to the terminal and browse to:
/Library/Java/JavaVirtualMachines
Next, if you see 1.6.0.jdk then you did not install the latest version of the jdk. Go to http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html to install the latest jdk. Next use the browse out to the same file path aforementioned and ensure the latest jdk is in there (i.e. jdk1.8.0_141.jdk).
To specify Java 6 for OS X:
-vm
/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/bin/java
For versions of Mac OS X 10.7+ the location has changed to
/Library/Java/JavaVirtualMachines/<''jdk_name_ver''>/Contents/Home/...
eclipse.ini > Specifying the JVM
Try any of these solutions
How do I run Eclipse using Oracle's new 1.7 JDK for the Mac?
Mountain Lion with Java 7 only
Eclipse still using java 6 as jre on Mac OSX
As I found out, we don't need to un-install an existing Java 1.6. Just installing or deploying a newer version 1.7 or 1.8, and setting the JAVA_HOME, along with the below given activities will solve the issue.
Check your c:/Windows/System32 (as I had this issue in windows). You will find junk java processes (java.exe, javaws.exe etc). Delete them all.
Deleting just java.exe will reflect in your PATH but eclipse still picks the javaws from c:/windows/system32. This is because, usually in PATH, you will have C:/Windows/System32 as the first entry. So, this will override any JAVA_HOME entry in the path.
Try starting the eclipse. It should work like charm! Atleast it did for me.
Try this
https://gist.github.com/johan/10590467
You might have to disable SIP and reenable it.
Okay so I have been struggling with this issue for a few days with Eclipse Neon and Oxygen. I was doing the below steps -
Check java -version from Terminal. It showed version as 1.7
Go to System Preferences -> Java -> Update Java version. Version 1.8 was downloaded and updated.
Went to Terminal again to confirm and this time it showed the version as 1.8.
But it still didn't work!! What was I missing now??
Here is what you need to keep in mind -- By default when you type the below command it shows the JRE version.
java -version
You need JDK to start your Eclipse installation. Please go to Java download page
and download the latest JDK version and you should be good to go.
Don't try to remove the Java in /System/Library/ - firstly this will not be allowed (you need to login as root user) and secondly you don't know the dependencies this Java version has on your other applications. Hope this helps!
Check your system variables ($JAVA_HOME specifically). This may be helpful:
http://www.mkyong.com/java/how-to-set-java_home-environment-variable-on-mac-os-x/
Install the updated JDK
Update the environment variables: here's how
If still not working uninstall the older JDK
I see that you have installed the Java plugin and not the jdk. You can download the JDK from Oracle Downloads section.
You can remove the Java Plugin and install JDK from oracle downloads to resolve your issue.
I have had the same problem as noted above. I could not get Eclipse to install because of Java incompatibilities. The sequence I followed goes like this:
Upgraded to MAC OS Sierra
Downloaded the Eclipse installer but was prompted that I needed to instal a legacy Java.Installed Java 1.6
Was unable to install Eclipse and was prompted that I needed Java 1.7 or greater. Downloaded and installed Java 1.8
Ran the terminal code 'java -version' // this will check your jre version. This showed returned Java 1.6 despite the fact that I had upgraded to 1.8. The Java version listed in the Java control panel said 1.8
Tried multiple downloads of eclipse and Java and multiple restarts always with the same result.
Visited the Oracle web page. I could not find the above reference to 8u73 and 8u74 but I did find and option to download 1.8.0_12. I did this. It installed without difficulty, and then I was able to install Eclipse without difficulty.
I was trying to upgrade Java 1.6.0 to the latest update 45. I first uninstalled the previous version (update 43), but this time for some odd reason the JDK installer (jdk-6u45-windows-i586.exe) does not install the "Public JRE" as it normally does along with the JDK. It does not even list it as options (it only shows Development Tools and Source Code, but does not list "Public JRE").
When I thus subsequently tried to install the JRE separately (using jre-6u45-windows-i586.exe), I got the message that the JRE was already installed.
So, for some odd reason the JDK installer (as well as the JRE-installer) seem to believe that JRE 1.6.0 update 45 is already installed while it is NOT.
Any idea, how to convince it otherwise?
This is on Windows 7 (x64 Enterprise) and with the 32-bit Java version (the 64 bit version installed fine as usual. I need both versions for test purposes just to avoid that question...)
I'm at a loss to understand what your problem is. The JDK install includes all of the tools and libraries that a JRE install contains. Add the bin subdirectory on your shell's PATH environment variable and both the JRE tools and the other tools can be used.