Eclipse does not launch (Ubuntu) : JVM terminated. Exit code=2 - java

I install ubuntu 14.04 LTS (64bit)
After that Install Eclipse Luno Standard for 64bit
Install Jdk and follow all the step for setting jdk using following link,
http://www.wikihow.com/Install-Oracle-Java-JDK-on-Ubuntu-Linux
Then After I enable to start my eclipse it giving me a following Error,
VM terminated. Exit code=2
/usr/bin/java
-Dosgi.requiredJavaVersion=1.6
-XX:MaxPermSize=256m
-Xms256m
-Xmx1024m
-jar /home/eheuristic/Ecclipse/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20140415- 2008.jar
-os linux
-ws gtk
-arch x86_64
-showsplash /home/eheuristic/Ecclipse/eclipse//plugins/org.eclipse.platform_4.4.0.v20140925- 0400/splash.bmp
-launcher /home/eheuristic/Ecclipse/eclipse/eclipse
-name Eclipse
--launcher.library /home/eheuristic/Ecclipse/eclipse//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1. 200.v20140603-1326/eclipse_1605.so
-startup /home/eheuristic/Ecclipse/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
--launcher.appendVmargs
-exitdata 208017
-product org.eclipse.epp.package.java.product
-vm /usr/bin/java
-vmargs
-Dosgi.requiredJavaVersion=1.6
-XX:MaxPermSize=256m
-Xms256m
-Xmx1024m
-jar /home/eheuristic/Ecclipse/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
I so much try to solve setting Environment variable but can't do, help me one suggest to how to solve it.

First, I strongly recommend you use the webupd8 ppa
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
Then to set it
sudo update-java-alternatives -s java-8-oracle
The advantage is ease of updates.

write in eclipse.in on the top of the file
-startu
-vm
/usr/local/jdk/jre/bin
change path according to your system

Had the same error. Solved it by:
sudo update-alternatives --config java
I started "using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java to provide /usr/bin/java (java) in manual mode" - that was option 4, and it worked fine.
I am using Luna Service Release 2 (4.4.2).
Hope it helps someone somewhere.

I know exactly how to solve your problem, go to search and put in environment, a prompt will come up and ask you to"edit environmental variables for your account" click that and a window will pop up. there will be the current paths which are running on the top (you should have your jdk version running mine is 1.8) and on the bottom part there will be paths too choose from. select (on the bottom part) the java path and delete it, then click okay. it should work

I find my Stupid Solution ,
I trying install jdk that is support for 32 bit.
I downloads new jdk1.8.0_25 for 64 bit and follow the step, i got solutions.

I had this same problem when trying to run Eclipse and Android Studio on Ubuntu with Java 9 .
Solution: Install Java 8 sudo apt-get install oracle-java8-installer
and set it as default
sudo apt-get install oracle-java8-set-default
and voilĂ .

Related

SDKMAN! does not work with Eclipse.app or SpringToolSuite4.app (on Mac)

This is a similar issue to:
Eclipse can't find jdk installed with sdkman
I am still facing the issue on Mac (macos-mojave)
Both of my
/usr/bin/java
/usr/bin/javac
are pointing to
/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java
/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/javac
respectively.
SDKMAN! does install the proper java and javac for the SDKMAN!'s default Java version.
Thus, I do have proper java and javac:
% java -version
openjdk version "11.0.3" 2019-04-16
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.3+7)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.3+7, mixed mode)
% javac -version
javac 11.0.3
However, I do not have any Java versions installed in:
ls -la /Library/Java/JavaVirtualMachines
total 0
drwxr-xr-x 2 root wheel 64 Jun 19 10:06 .
drwxr-xr-x 4 root wheel 128 Apr 16 06:16 ..
EDIT:
I also tried updating the JVM reference in /Applications/SpringToolSuite4.app/Contents/Eclipse/SpringToolSuite4.ini (comparable to Eclipse.ini):
-vm
/Users/johndoe/.sdkman/candidates/java/current/bin/java
-startup
../Eclipse/plugins/org.eclipse.equinox.launcher_1.5.300.v20190213-1655.jar
--launcher.library
../Eclipse/plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.1000.v20190125-2016
-product
org.springframework.boot.ide.branding.sts4
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.8
-Xms256m
-Xmx1024m
-XX:+UseG1GC
-XX:+UseStringDeduplication
--add-modules=ALL-SYSTEM
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-Xdock:icon=../Resources/sts4.icns
I do get a splash screen for STS, but it still reports no JVMs installed (see screenshots)
And it seems both Eclipse.app and SpringToolSuite4.app require proper JDK installed traditionally, not using SDKMAN!
I really don't want to install another JDK besides SDKMAN!
Anyone got this to work?
Thanks!
Here is how I got it working [1] on MacOS Catalina.
I had to set the -vm path in my eclipse.ini to:
/Users/<YOUR_USER>/.sdkman/candidates/java/current/lib/jli/libjli.dylib
Apparently Eclipse on MacOS always uses JNI invocation to load the VM [2] so I had to make it point to the libjli.dylib instead of the regular java executable.
Links:
[1] Thanks to: https://bugs.eclipse.org/bugs/show_bug.cgi?id=549813
[2] https://help.eclipse.org/2020-03/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Flauncher.html&cp%3D2_1_5_1
If the Eclipse launcher cannot find a suitable JVM to run on (which I am assuming is the problem here), you can usually work around this by pointing the 'eclipse.ini' (or 'STS.ini' as the case may be) to the JVM of your choice.
To do this, open the .ini file in a text editor and add two lines at the front of the file. Something like this:
-vm
/usr/lib/jvm/jdk-1.8.0/bin/java
... the rest of the file unchanged...
Note it is important that:
1) these lines are the very first in the file
2) they are on two separate lines (don't try to put both -vm and path of the jvm executable on a single line, it doesn't work).
I faced this problem on macOS Sierra while trying to use OpenJDK 11.0.2 installed by SDKMAN! in conjunction with Eclipse 2019-06. No other SDKs installed.
macOS consistently seems to refuse launching Eclipse.app for almost all combinations of -vm parameters I supplied in Info.plist and eclipse.ini, except for links to /System/Library/.
Here is my working setup:
I did an sdk default java 11.0.2-open rather than just sdk use.
I made sure SDKMAN! symlinked JDK command binaries properly into the /System/Library path:
lrwxr-xr-x 1 root wheel 75 1 Mai 2017 /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java
Although the symlink destination is not a link anymore, it is the binary that SDKMAN! deployed there. Check it with the -version.
I made sure no <string>-vm</string> parameter is present in Info.plist. All commented out.
My -vm arg in eclipse.ini is:
-vm
/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java
As stated previously, make sure this statement appears before -vmargs.
This finally allows me to launch a recent Eclipse by double-clicking in the Finder or launching the eclipse binary directly. Hope this applies to STS as well.
Good luck.

Spring Tool Suite failing to start with error

I was using Spring tool suite, I just upgraded it to latest version spring-tool-suite-3.5.1.RELEASE-e4.3.2-linux-gtk-x86_64 and now I am not able to start it. It gives below error:
VM terminated. Exit code=1
/usr/bin/java
-Dosgi.requiredJavaVersion=1.6
-Xms40m
-Xmx768m
-XX:MaxPermSize=256m
-jar /home/vishal/install/sts/sts-3.5.1.RELEASE//plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
-os linux
-ws gtk
-arch x86_64
-showsplash
-launcher /home/vishal/install/sts/sts-3.5.1.RELEASE/STS
-name STS
--launcher.library /home/vishal/install/sts/sts-3.5.1.RELEASE//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20140116-2212/eclipse_1508.so
-startup /home/vishal/install/sts/sts-3.5.1.RELEASE//plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
--launcher.overrideVmargs
-exitdata 98006
-product org.springsource.sts.ide
-vm /usr/bin/java
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Xms40m
-Xmx768m
-XX:MaxPermSize=256m
-jar /home/vishal/install/sts/sts-3.5.1.RELEASE//plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
I have ubuntu 12.04 and this Java version:
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
This is STS.ini
-vm
/usr/lib/jvm/jdk1.7.0/bin/java
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20140116-2212
-product
org.springsource.sts.ide
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Xms40m
-Xmx768m
-XX:MaxPermSize=256m
The above error cause by STS version.
At this site: http://spring.io/tools/sts/all , Download STS version what support 32 bit (x86) or 64 bit (x64) computer.
I am not a java developer but had to look into java code.I faced the same issue stated above and fixed it in different way. located STS.ini, opened it and changed the version from 1.6 to 1.7. bingo... its started working..
I faced the same problem after another software updated 1.8 32 bit client VM, where I am running on 64 bit Windows 7. This issue was resolved after I installed JDK 1.8 64 bit Server VM.
The .ini file you posted points to /usr/lib/jvm/jdk1.7.0/bin/java but the error log shows it's actually using /usr/bin/java. That suggests you're not using the .ini you think you are. Double check you're launching from the correct directory/executable.
May not be the case here, but usually this kind of error means the JVM is 32 bit where it needs to be 64 bit or vice versa. Double check that the JVM you are using matches your downloaded STS with respect to 32/64 bit.
Also the answer from E-Riz makes sense. Check exactly what '/usr/bin/java' actually points to (it is probably a symlink). Try the following commands
/usr/bin/java -version
Also track down the symlink
ls -la /usr/bin/java
This will tell you where it points (probably /etc/alternatives/java, which is another symlink. Repeat until you get to the end of the symlink chain. If this doesn't lead to where you think it should (i.e. /usr/lib/jvm/jdk1.7.0/bin/java) then E-riz is right and you are probably not running the STS.ini that you think you are.
I tried to resolve this error in so many ways, but nothing worked for me. At last I uninstalled all my java installations from Control Panel, and reinstalled Java 1.8 and it worked :)
This error with STS is pretty common when you start for the first time. Here is what I found on YouTube, will help eliminate the error: https://youtu.be/cMClVM6rzuc
I had the same issue when trying to open Sprint STS on my Windows machine (64 bits).
The problem was, in fact, that the STS download page, by default, downloads the Windows 32 bits version and it was not working because of that on my 64 bits Windows.
I just went to the STS download page again and download the right version (64 bits) and it solved my issue.
Best regards!

How to launch eclipse on Ubuntu 12.04

JVM terminated. Exit code=2
/usr/local/bin/java
-Xms40m
-Xmx384m
-Dorg.eclipse.equinox.p2.reconciler.dropins.directory=/usr/share/eclipse/dropins
-jar /usr/lib/eclipse//plugins/org.eclipse.equinox.launcher_1.2.0.dist.jar
-os linux
-ws gtk
-arch x86_64
-showsplash
-launcher /usr/lib/eclipse/eclipse
-name Eclipse
--launcher.library /usr/lib/eclipse//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.100.dist/eclipse_1408.so
-startup /usr/lib/eclipse//plugins/org.eclipse.equinox.launcher_1.2.0.dist.jar
--launcher.overrideVmargs
-exitdata 428003
-clean
-initialize
-vm /usr/local/bin/java
-vmargs
-Xms40m
-Xmx384m
-Dorg.eclipse.equinox.p2.reconciler.dropins.directory=/usr/share/eclipse/dropins
-jar /usr/lib/eclipse//plugins/org.eclipse.equinox.launcher_1.2.0.dist.jar
So java -version give path not found. I have tried the following:
Edit ~/.bashrc ~/.profile /etc/environment bash.bashrc files and add to them the following
JAVA_HOME=/usr/lib/jvm/jdk1.7.0_15
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
JRE_HOME=/usr/lib/jvm/jre1.7.0_15
PATH=$PATH:$HOME/bin:$JRE_HOME/bin
export JAVA_HOME
export JRE_HOME
export PATH
In addition, I also manually added the java bin directory to PATH. I have restarted my computer several times but I still get
bash: /usr/local/bin/java: No such file or directory
Put $JAVA_HOME/bin at the front of your path. Don't put $JRE_HOME/bin in your path at all.
Currently you're picking up some other file (probably a symlink) in /usr/local/bin, because that directory appears first in your path.
I'm not sure why you installed Java in /usr/lib; is that where the Ubuntu installer puts it? If yes, then I would expect /usr/local/bin/java to point to a valid file. You might want to double-check that.
And finally (the reason I asked for the output of java -version), make sure that you're running an x64 version of the JVM, because that's the version of Eclipse that you're using.
So where do you have Java installed, to /usr/local/bin/java or to /usr/lib/jvm/jdk1.7.0_15/bin/java?
Do a ls -l /usr/local/bin/java /usr/lib/jvm/jdk1.7.0_15/bin/java, what is the result?
Maybe, you need to update the references to your compiler path, since your ubuntu is not recognizing the path where you installed jdk or jre:
Use this command to see what are the java versions in your computer:
sudo update-alternatives --config java
Then if necessary, update the location of the jdk and jre you're using:
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/java-6.31-oracle/bin/javac" 1
And then, please, execute this:
sudo update-alternatives --config javac
I had a similar problem and solved by using this commands.
Hope it will help you.
so the problem was admin rights issue on my corporate network, because my account has limited access even with sudo. I'm reinstalling my computer with full admin rights

Eclipse does not launch (Ubuntu) : JVM terminated. Exit code=13

I have a problem with Eclipse. When I try to launch it, I get this error message:
JVM terminated. Exit code=13
/usr/bin/java
-Xms40m
-Xmx384m
-Dorg.eclipse.equinox.p2.reconciler.dropins.directory=/usr/share/eclipse/dropins
-XX:MaxPermSize=256m
-jar /usr/lib/eclipse//plugins/org.eclipse.equinox.launcher_1.2.0.dist.jar
-os linux
-ws gtk
-arch x86_64
-showsplash
-launcher /usr/lib/eclipse/eclipse
-name Eclipse
--launcher.library /usr/lib/eclipse//plugins /org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.100.dist/eclipse_1407.so
-startup /usr/lib/eclipse//plugins/org.eclipse.equinox.launcher_1.2.0.dist.jar
--launcher.overrideVmargs
-exitdata a8004
-vm /usr/bin/java
-vmargs
-Xms40m
-Xmx384m
-Dorg.eclipse.equinox.p2.reconciler.dropins.directory=/usr/share/eclipse/dropins
-XX:MaxPermSize=256m
-jar /usr/lib/eclipse//plugins/org.eclipse.equinox.launcher_1.2.0.dist.jar
I have found the same error code but not the same text below, and the proposed solutions didn't work.
Can you help me?
Usually has to do with incompatible architectures of Eclipse and the JVM. I am betting you got eclipse 32 bit trying to run on 64 bit jvm.
As mentioned above, you are most certainly using incompatible JVM.
Run the following command to check and set proper JVM:
sudo update-alternatives --config java
It is okay that the error message is different, because you are starting eclipse with different parameters and the error message is simply listing the parameters. Thus, the answers provided by google will work, and I think that the information provided in the following pages will be enough.
http://www.ehow.com/how_4784069_terminated-exit-code-error-eclipse.html
Cannot run Eclipse; JVM terminated. Exit code=13
I had similar problem. It solved after, I have download JRE from http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.html
and put it in the path of eclipse as shown below -
abc#ubuntu:~/Downloads/eclipse$ ls
about_files
configuration
eclipse.ini
icon.xpm
p2 about.html
dropins
epl-v10.html
jre
plugins artifacts.xml
eclipse
features
notice.html
readme
I hope it helps.

Setting up eclipse on ubuntu

I have a small problem with Eclipse on my Ubuntu machine. I installed JDK, set JAVA_HOME and PATH variables, all seems correct, but eclipse refuses to launch and throws an error:
A Java Runtime Environment (JRE) or Java Development Kit (JDK) must be
available in order to run Eclipse. No Java virtual machine was found
after searching the following locations: /opt/eclipse/jre/bin/java
java in your current PATH
have no clue what's the problem. help please.
note:
I am able to run java and javac in terminal.
If you get this error even though you already have JDK in your system-just follow this steps:
1)open eclipse.ini file with text editor.
2)copy your jdk path by using -vm command (vm and your path should not be in same line)
eg:
-vm
/usr/lib/java/jdk1.7.0_75/jre/bin/java
3)-vm should be placed before -vmargs in eclipse.ini file.
99% works if you follow above simple steps
This worked for me:
ubuntu:~$ sudo apt-get install default-jre
You need to create a link at /usr/bin/java for the java binary (wherever you have placed it).
sudo ln -s /path/to/jre*/bin/java /usr/bin/java
You probably need to set your JAVA_HOME env var something like:
export JAVA_HOME=/apps/java/jdk1.6.0_13
Check this answer out
open your eclipse.ini file
add
-vm
usr/lib/jvm/jdk1.8.x_xx/jre/bin/java
this must be placed before -vmarg
save the file
start your eclipse
Happy Coding...
it seems eclipse looks for java under /usr/bin directory, making a symbolic link of the java command in this dir would solve your problems, at least solve mine
I have to run a number of jre and jdks on my machine and did not want to mess with the environment. I wanted to keep 1.6 for my environment but run eclipse under 1.7. I added the following line to my elcipse.ini file to specify the exact jvm to run eclipse:
-vm
/usr/lib/jvm/jdk1.7_latest/bin/java
Obviously your path might be different. Note that above jdk1.7_latest is a symlink to the specific version of the latest Java 7 jdk.
Hope that helps somebody.
This is the problem of your jdk is not setup properly for current profile.
Before starting eclipse in your current profile. Run "java -version" command on your current profile where you are running eclipse. Surely it will ask to install jdk/jre even jdk already installed but on different profile.
Hence there is two way:
Solution 1. install jdk on current profile edit and add following lines
vi /etc/profile
export JAVA_HOME=/usr/local/jdk-1.8
export PATH=$PATH:$JAVA_HOME/bin
Solution 2: ~/.profiles
export JAVA_HOME=/usr/local/jdk-1.8
export PATH=$PATH:$JAVA_HOME/bin
Solution 3: I tried and working perfectly for me.
1. gedit /home/../eclipse/eclipse.ini
2. Add following line before -vmargs and any plugin or jar execution in eclipse.ini file
-startup
-vm
/usr/local/java/jdk1.8.0_251/bin/java.exe
plugins/org.eclipse.equinox.launcher_1.5.700.v20200207-2156.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.1100.v20190907-0426
-product
org.eclipse.epp.package.jee.product
-showsplash
org.eclipse.epp.package.common
--launcher.defaultAction
openFile
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.8
-Dosgi.instance.area.default=#user.home/eclipse-workspace
-XX:+UseG1GC
-XX:+UseStringDeduplication
--add-modules=ALL-SYSTEM
-Dosgi.requiredJavaVersion=1.8
-Dosgi.dataAreaRequiresExplicitInit=true
-Xms256m
-Xmx2048m
--add-modules=ALL-SYSTEM
This solution is perfectly working after explore from many stackoverflow suggestions and blogs.

Categories

Resources