My operating system is openSUSE Leap 42.1. I installed both JRE and JDK. Here are the results of some useful commands.
void@linux:~> java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
void@linux:~> whereis java
java: /usr/bin/java /usr/lib64/java /etc/java /usr/share/java
void@linux:~> readlink -f $(which java)
/usr/java/jdk1.8.0_121/bin/java
Then I added 2 lines of codes to Eclipse's eclipse.ini file according to the answer of this question.
-vm
/usr/java/jdk1.8.0_121/bin/java
It failed. So I changed the last part with /usr/bin/java. It failed again. And here is the failure of first trial:
JVM terminated. Exit code=1
/usr/bin/java
-Dosgi.requiredJavaVersion=1.7
-XX:MaxPermSize=256m
-Xms256m
-Xmx1024m
-vm /usr/java/jdk1.8.0_121/bin/java
-jar /home/emre/eclipse//plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar
-os linux
-ws gtk
-arch x86_64
-showsplash /home/emre/eclipse//plugins/org.eclipse.platform_4.5.2.v20160212-1500/splash.bmp
-launcher /home/emre/eclipse/eclipse
-name Eclipse
--launcher.library /home/emre/eclipse//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.300.v20150602-1417/eclipse_1612.so
-startup /home/emre/eclipse//plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar
--launcher.appendVmargs
-exitdata 52000e
-product org.eclipse.epp.package.java.product
-vm /usr/bin/java
-vmargs
-Dosgi.requiredJavaVersion=1.7
-XX:MaxPermSize=256m
-Xms256m
-Xmx1024m
-vm /usr/java/jdk1.8.0_121/bin/java
-jar /home/emre/eclipse//plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar
I moved -vm
and /usr/java/jdk1.8.0_121/bin/java
lines in front of the -vmargs
. So finally it looks like this:
-vm
/usr/java/jdk1.8.0_121/bin
-vmargs
So it worked.