Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Version 1.6.0_65 of the JVM is not suitable for this product

Trying to install eclipse

enter image description here

and I get an error

Version 1.6.0_65 of the JVM is not suitable for this product.

Java -version from command line says

Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode)

How can I change that to a compatible version? I did google this and cruise this site for answers with the suggested questions when writing this but was not able to find something that solved it. I found a few answers telling you to do this (with my current installed version in)

 export JAVA_HOME=`/usr/libexec/java_home -v 1.8.*'

When I run the EXPORT command it just takes me to a command line and from there I have no idea what to do.

I did download the 64-bit version.

Seems like it should be an easy thing to do....

like image 971
Rockwell Rice Avatar asked Aug 22 '15 17:08

Rockwell Rice


People also ask

How do you solve incompatible JVM version 1.8 0_261 of the JVM is not suitable for this product version 11 or greater is required in Eclipse error?

If you're looking to resolve this without changing eclipse. ini file, just reinstall eclipse IDE. It can be the same version or newer one. I have reinstalled the same version and it's worked without issues, no needing of changing eclipse.

What version of Eclipse works with Java 11?

Eclipse 4.23 (2022-03) It is the supported release. A Java 11 or newer JRE/JDK is required, LTS release are preferred to run all Eclipse 2022-03 packages based on Eclipse 4.23, with certain packages choosing to provide one by default.


1 Answers

Right click Eclipse and click Show Package Contents

enter image description here

And open Contents\info.plist in a texteditor

enter image description here

Then search for <key>Eclipse</key> and immediately after the <key>Eclipse</key> you will have <array> tag, add the following inside <array> tag.

<string>-vm</string>
<string>YOUR_JAVA_HOME/jre/lib/server/libjvm.dylib</string>

Replace YOUR_JAVA_HOME with the output of /usr/libexec/java_home -v 1.8.*. Then eclipse will run on that particular JVM.

For example my Info.plist has the following

<key>Eclipse</key>
<array>
    <string>-vm</string>
    <string>/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre/lib/server/libjvm.dylib</string>
    <string>-keyring</string>
    <string>~/.eclipse_keyring</string>
    <string>-showlocation</string>
</array>
like image 166
Karthikeyan Vaithilingam Avatar answered Nov 04 '22 21:11

Karthikeyan Vaithilingam