Eclipse: Could not find Java 2 Runtime Environment - java

I just installed Eclipse 3.5. Before I could install the Android Plugin I needed to install a Java jdk, which I did. After restart Im not able to start Eclipse anymore, because I receive the following error:
Error: could not finde Java 2 Runtime
Environment
The weired thing is, that now I cant even open my other Eclipse Installations, that I use for PHP Programming. Any suggestions?
Update:
This is my eclipse.ini:
-startup
plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.0.200.v20090519
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
-vmargs
-Xms40m
-Xmx256m

You can explicitely tell your eclipse session which jdk/jre you want it to start with adding the following in your eclipse.ini:
-vm
c:/your/jre/bin/javaw.exe
For more info on how to startup your eclipse refer here

I had a similar problem, with exception that Java was installed successfully.
Once I added c:/my-path-to-java/jre/bin to PATH (system environment variable), Eclipse started successfully.

Change the PATH environment variable from something like
...;%SystemRoot%\System32;...;C:\Program Files\Java\jdk1.7.0_17\bin;...
to something like
...;C:\Program Files\Java\jdk1.7.0_17\bin;...;%SystemRoot%\System32;...

Check your path variable from Computer's System Properties Environment Variables JAVA_HOME to ocorrect path to your jdk installation

Wonder if the Java install might be corrupt. Can you run the following on the Run prompt and paste what you get in code tags:
dir /d /s "%JAVA_HOME%" > "%HOMEPATH%\java2.txt" && notepad "%HOMEPATH%\java2.txt"

It makes sense that your PHP eclipse won't start either. Eclipse runs on java itself. Probably it cannot find the JRE.
so I see two possibilities:
The JRE is corrupt and you should reinstall it
Eclipse is getting confused by the 2 jre (unlikely to me) and you need to point it to the right one (as suggested by Dimistrisli).

I had the same issue. Eclipse (3.7) worked just fine for a while with JDK 6, and then I installed JRE 5 (please don't ask me why)
This eclipse wiki page, which seems up to date, states that:
If a JVM is installed in the eclipse/jre directory, Eclipse will use
it; otherwise the launcher will consult the eclipse.ini file and the
system path variable. Eclipse DOES NOT consult the JAVA_HOME
environment variable
And indeed, I did not change JAVA_HOME so that couldn't be it.
However, at the bottom of the same wiki page, someone added:
A comment on the JVM search order (on Windows) - My testing (Windows
7, Eclipse 3.4.1) shows that Eclipse also looks for a JVM in the
registry, in my case HKLM\Software\Wow6432Node\JavaSoft\Java Runtime
Environment
So I found the mentioned registry entry, which now had the value of "1.5" and changed it to "1.6", then restarted my PC (windows 7), and voila - Eclipse went back alive.
I agree that adding "-vm" might fix this, although it didn't seem to work for me (maybe I didn't add it in the right place/format). But IMO, the registry fix was the better one in my case. After restarting my computer and seeing Eclipse was back to normal, I uninstalled JRE 5 (through "Add or remove programs") just to tie up loose ends.

In my case installing the most recent JRE worked well: http://www.oracle.com/technetwork/java/javase/overview/index.html

I had the same problem when I recently installed JDK 7 Update 9. My eclipse did not open and when I run "java -version" from CMD, it did not work either.
I had PATH variable set to the correct bin directory.
Anyways, eventually when I set JAVA_HOME to the new installation directory, eclipse started fine. Not sure what is the problem with JDK 7 Update 9.

Make sure everything is setup correctly under "installed JREs" under the Eclipse preferences.

The simple solution that worked for me, since other resolution required admin privilege is executing the below command from command prompt
eclipse -vm C:\Java\jdk1.7.0_72\bin\javaw
Also, to make the eclipse shortcut work by editing the shortcut.Append -vm C:\Java\jdk1.7.0_72\bin\javaw in the target section

Related

I have set all JDK / JRE environment variables correctlly but fails to install Eclipse. [duplicate]

I am trying to use Eclipse on a friends computer but we keep getting this when we run Eclipse
We have the environmental variable set as well.
Edit
it was working before he installed the black berry plug in.
The variable JAVA_HOME is not required by Eclipse. If your Java installation does not put the Java executables in the PATH, you should add those manually.
A faster way to have your Eclipse up and running consists in modifying the eclipse.ini and using the -vm option.
http://wiki.eclipse.org/Eclipse.ini#-vm_value:_Windows_Example
I had the same problem. For me, I needed the JDK. So I had to install the JDK. It should match the build platform that is, 64bit vs. 32bit windows. After that, I removed, the -vm line from the eclipse.ini file (the suggested fix). It was giving me the "Can't create virtual machine" error. The current release of JDK is version, 7 whereas the Android Developers Toolkit version of eclipse is currently based on JDK 6. But it seems to work. Eclipse came up and is functional. Haven't actually written a program yet.
Go to eclipse folder (where eclipse is installed) and open eclipse.ini file in your editor and add the following code after openFile tag.
-vm C:\Program Files\JDK6\bin\javaw.exe
That's all.
I had a similar problem, since our Java and JDK is consistently updated by our service desk, including uninstalling old JDKs. They take care of the PATH for us, but then the JRE that Eclipse was used to "seeing" was gone. So, the thing that has worked best for me is to modify the shortcut's "target" from:
"C:\Program Files\Eclipse\Eclipse IDE for Java EE Developers\eclipse.exe"
to
"C:\Program Files\Eclipse\Eclipse IDE for Java EE Developers\eclipse.exe" -vm "C:\Program Files\Java\<jdkver>\jre\bin\javaw.exe"
That will point Eclipse toward to the JRE in the JDK you want it to use, and then you can update that shortcut when your JDK updates.
This is on Windows 64bit, obviously.
It can also happen on mismatch of JAVA and Eclipse bit version.
for eg:
If in your System java is 32 bit and you are trying to install Eclipse of 64 bit then the same situation might occur.
Because Eclipse will look Java in Program Files while at the same time Java may be present in Program Files (x86).
So in this case eclipse will not get java and throw the same error.
While installing eclipse, Jre missing :
I solved my error as follows:-
This error may comes if you have 2 program files folder in your system.
"Program files" &
"Program files x86".
Please install JDK&JRE in the "Program files" folder.
Hope your jre missing error get solved.
this works for me:
open eclipse.ini file in your editor and add the line: -vm C:\Program Files\JDK11\bin\javaw.exe
update system PATH with correct JDK path.

eclipse adt bundle installation [duplicate]

I just append
-vm
C:\Program Files\Java\jre6\bin\javaw.exe
in eclipse.ini then I try to start eclipse again and got this error. Give me how to solve or link that actually solve it.
this is my eclipse.ini
-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.1.R36x_v20100810
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize 256m
--launcher.defaultAction
openFile
-vm
C:\Program Files\Java\jre6\bin\javaw.exe
-vmargs
-Xms40m
-Xmx384m
Thank you
I had the same error when configuring eclipse.ini to use JRE6. Turns out I caused this error by incorrectly configuring eclipse to use the 64 bit JVM while running a 32 bit version of eclipse 3.7.
The correct configuration required the eclipse.ini -vm argumument to use "C:/Program Files (x86)/" instead of "C:/Program Files/".
Make sure that the JVM version (32/64 bit) you use matches the eclipse version (32/64 bit).
It may just be the way the error shows (and not how it is written in the eclipse.ini file), but there is text in Eclipse.ini (Specifying the JVM) that says the following:
The -vm option and its value (the path) must be on separate lines.
The value must be the full absolute path to the Java executable, not just to the Java home directory.
The -vm option must occur before the -vmargs option, since everything after -vmargs is passed directly to the JVM
Look at the second line of the message box. There you can see which java runtime in fact is started. Mine was suddenly C:\ProgramData\Oracle\Java\javapath\javaw.exe. This happened after I have installed a "chrome java updater" (Chrome browser moaned: 'your java is outdated, you have to update...').
Before this "chrome java update" my eclipse (luna jee x64) started without error. Looking closer to the background I detected following: the chrome java updater (notabene started from an Oracle site) added C:\ProgramData\Oracle\Java\javapath in front of the env var PATH. It contains three symbolic links to the newest java 8 JRE installation in (x86) program folder -> hence to a 32 bit java JRE. Oracle replaces with Java8 the old technique having the symlinks in system32 (64bit) resp. SysWOW64 (32bit).
Meanwhile I learned. Whatever java installer you have executed last (the *.exe) leads windows to remember that java flavour (32b or 64b), with the result that after an update the links in C:\ProgramData\Oracle\Java\javapath point to a java installation of the remembered flavour. If you have a 64b eclipse installation and encounter the described error: just re-install the newest 64b JDK. After that the java updates do no more link to a 32b version. And eclipse 64b will start correctly without the entry in eclipse.ini .
You need to check if your PC has a 64-bit or 32-bit operating system, then same goes for your JDK (64-bit/32-bit) and also for Eclipse (64-bit/32-bit).
Make sure they are all the same; if not, you need to download the one that matches your bitness.
For Eclipse:
Added this two lines in eclipse.ini
Second line represents the JDK location of the javaw.exe file.
-vm
C:\Program Files\Java\jdk1.7.0_60\bin\javaw.exe
Note: place -vm lines before -vmargs, otherwise default location is taken.
For STS
Change the same as above in STS.ini
I just hit this too. Turns out that at least for me, this was due to trying to use a win64 version of the JRE with a win32 Eclipse. I seems that win32 Eclipse requires a win32 Java (what is called -586 in the list of Java installers from Oracle/Sun).
The reason I was using both is that I was trying to pinpoint a bug that only manifested itself in 64-bit Eclipse, so I needed a 32-bit to compare to.
Once I installed BOTH the "x64" (win64) and "i586" (win32) versions of the JRE on my machine, things work fine and no error 13. You can apparently have both installed at the same time.
The error means it's the wrong JVM version for that version of Eclipse. The link has more details:
http://www.ehow.com/how_4784069_terminated-exit-code-error-eclipse.html
Make sure the Eclipse and the Java that you are using are both either 32-bit or 64-bit.
You cannot run 64-bit eclipse with 32-bit JRE.
java -version
Java HotSpot(TM) 64-Bit Server VM
The 32 bit version JRE will not have 64-Bit in it.
I just had the same issue, and spend about an hour trying to solve the problem.
In the end it was a '#' character in the path.
So I renamed "C:\# IDE\eclipse 3.7\" to "C:\+ IDE\eclipse 3.7\" and that solved the problem.
Recently I faced same issue.My version of eclipse didnt support java version 8.
I had accidently installed jre 8 on my machine which automatically updated my PATH variable by appending "C:\ProgramData\Oracle\Java\javapath" in the beginging which led eclipse to pick up this version(and ignore the manually added 1.6 version which came later in order)and crash with exit code 13.
I just removed this string from the path so which led system to pick up my older version and eclipse started just fine.
I had the same issue with eclipse in my both machine. I had jre 32 bit installed. So I removed 32 bit and installed 64 bit instead and it worked perfectly.
simply install 64 bit version of JAVA from http://java.com/en/download/manual.jsp
and uninstall older version if prompted by the 64 bit installer
Go to the folder where you saved Eclipse. Look in the configuration folder at the startup log. It will give you a much better diagnostic than "exit code 13".
After java update, eclipse will not start because default jdk location has changed. Adding the following lines to eclipse.ini file solved my problem immediately:
-vm
C:\Program Files (x86)\Java\jdk1.7.0_75\bin\javaw.exe
I added these lines just before vmargs. It looks like as the following :
...
--launcher.defaultAction
openFile
-vm
C:\Program Files (x86)\Java\jdk1.7.0_75\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Dhelp.lucene.tokenizer=standard
-Xms40m
-Xmx512m
For more information on eclipse.ini, visit this the site http://wiki.eclipse.org/Eclipse.ini#-vm_value:_Windows_Example
In my case, i use 32 bit eclipse and java. If you installed both 32 bit and 64 bit versions of java, be careful to choose the right version. For 64 bit versions, refer to the javaw.exe file under the directory
C:\Program Files\Java\jdk1.8.0_60\bin
Whenever you see this error, go to Configuration directory and check for a log file generated just now. It should have proper Exception stacktrace. Mine was a case where I got an updated 32-bit JRE (or JVM) installed which was the default Java that got added to the Path. And my Eclipse installation was 64-bit which meant it needed a 64-bit VM to run its native SWT libraries. So I simply uninstalled the 32-bit JVM and replaced it with a 64-bit JVM.
I wonder if they will improve this reporting mechanism, instead of silently generating a log file in some directory.
This error occurred to me on ubuntu, having installed 32bit and 64bit java. Use
sudo update-alternatives --config java
to set the right version to use as default.
Just uninstalled jre-32 bit version and It worked fine for me.
I was using Eclipse Juno and I didn't remember if it was 32 or 64 bits. I installed Java 32 bits and that's why it failed. I then installed Java 64 bits and Eclipse Juno is working again.
I also removed any java or jre reference in my environment variables (PATH).
In my opinion the most answers here regarding different architectures of Eclipse and Java are simply wrong and this can be easily checked using e.g. Process Monitor under Windows. The -vm option is there to run a specific version of java and the point of it is, that the configured process is started and runs all the Java code on its own, that's why you configure up to java.exe. In that case you DON'T need to have the same architecture for Eclipse and Java, but can happily mix both 32 Bit and 64 Bit. You only CAN'T mix both, if you DON'T use -vm, but let Eclipse load Java natively into its own process using jvm.dll and such. That latter behavior is Eclipse's default, but not the case anymore if you properly configure -vm in eclipse.ini.
If you don't believe me, do some tests on your own using different architectures of Eclipse and Java and do configure -vm or not properly. In the end, that's exactly what the questioner described in his comment to the accepted answer:
Cannot run Eclipse; JVM terminated. Exit code=13
He is telling that a 64 Bit JDK is working now, but in his screenshot one can see that his Eclipse is 32 Bit, because the path for launcher.library is 32 Bit.
And now for the reason I came here: Ony of my customers had some problems loading one of our Eclipse/OSGI based applications as well and Java exited with exit code 13. In the end it showed that the problem was not about -vm or the architectures of Java and eclipse.exe, but instead he was simply missing config.ini and I guess eclipse.exe wasn't aware what to load or such. After we recognized that and put a config.iniback in place, the app loaded fine with using -vm and a 64 Bit JRE7 in combination with a 32 Bit eclipse.exe.
I had the same issue on Ubuntu, and solved it by unpack all *.pack files in jdk directory.
for example:
cd /usr/java/jdk1.7.0_03/jre/lib
sudo ../bin/unpack200 rt.pack rt.jar
use the configuration below;
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20130807-1835
-product
org.springsource.ggts.ide
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-vm
C:\Program Files\Java\jdk1.7.0_51\jre\bin\javaw.exe
-vmargs
-Dorg.eclipse.swt.browser.IEVersion=10001
-Dgrails.console.enable.interactive=false
-Dgrails.console.enable.terminal=false
-Djline.terminal=jline.UnsupportedTerminal
-Dgrails.console.class=grails.build.logging.GrailsEclipseConsole
-Dosgi.requiredJavaVersion=1.6
-Xms40m
-Xmx768m
-XX:MaxPermSize=256m
-Dorg.eclipse.swt.browser.IEVersion=10001
I fixed it reinstalling the jdk. In my case it was necessary to do:
java -version
sudo apt-get purge openjdk*
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
java -version
javac -version
taken from Install Java JDK+JRE (oracle) in Kubuntu 13.04 from apt
In my case JAVA path was not set in Env variables. Started to work after correct path was set in Env PATH.
Type javac in command prompt and make sure JAVA PATH is correct.
I did couple of things inorder to get rid of this annoying error as modifying .ini never worked for me.
Installed latest JDK
Delete old eclipse IDE folder completely.
This time i Unziped to different location
Double Click "eclipse.exe" Works now like charm
Use default workspace to load your old projects.
Am suspecting it to be JDK's Java VM issue more than eclipse.
I used the new Eclipse Installer. I didn't like the installation path and I changed it manually. After that, I got the exit code=13 message too.
There is a new property in the eclipse.ini file named -install. I just had to modify it with the new location, and that solved this issue.
In the new installer I selected D:/eclipse, but the IDE was installed at D:/eclipse/eclipse. So, I moved the folder manually. The next time I tried to open eclipse I got the exit error. Thus, I had to modify eclipse.ini and set the current location:
-install
D:/eclipse
Before going to the solution, let us know why it is showing that error. If you know the problem behind this issue we can easily fix that error.
Reason 1: The most common reason behind this problem is, we are trying to install different bit version-that is, 64 bit or 32 bit version of the software. It maybe either Eclipse or Java.
Solution:
Check which version of operating system you are running.make sure you downloaded the same version of Eclipse as well as same version of Java software.
Reason 2: Configuration mistake in Eclipse.ini file
Solution:
Add this line "-vm then path of your java sdk" at the end of Eclipse.ini file. for example:
-vm
C:\Program Files\Java\jdk1.7.0_71\bin\javaw.exe
Reason 3: Special characters ( #, !, #) in Eclipse installation directory.
Solution:
Make sure you don’t have any special characters.
Reason 4: You have added JAVA path two times in PATH system variable and both the path are different.
Solution:
Remove one incorrect/different JAVA path from PATH system variable.
Reason 5: You maybe using latest version of Eclipse, but you might be using wrong version or unsupported version of Java Virtual Machine (JVM).
Solution:
To check which version of java you are using open command prompt by pressing win+R key and type cmd and press enter. Now in that console type Java -version command to know java version.
Now research whether eclipse support that version or not.
Or
You can open “readme” folder in Eclipse folder and open readme_eclipse.html to see which version it supports.
for ones with Eclipse Neon
I wanted to run Eclipse Neon and had JRE 1.8 but JDK 1.7
It returned error=13
then I installed java JDK 1.8 and everything worked like a charm
I had this issue also. I had an old JDK1.8.0_05. I installed the newest JDK1.8.0_111 and everything works great now. Just be sure to update your environment variable.
I am on Windows 7 64 bit.
Using Eclipse Neon 1a.
Hope that helps someone.
I face same issue with sts 3.8.4, so I tried different settings but not luck,
I reinstall jdk again n tried but same problem.
Finally I downloaded sts 3.8.2 n it runs with out any issue.
Using windows 8, 64 bit os.
thanks
This can happen when the PATH environment variable is point to a wrong java instalation.

Installed Eclipse, but it won't start

My Eclipse Kepler had been running just fine until I messed up some settings and then had to delete the installation directory and re-extract the zip file. I also deleted the workspaces.
But after I had extracted the zip file, the Eclipse just won't start.
I tried extracting to another drive (C:) this time, still won't start.
Also tried the -clean option, but to no avail.
What went wrong?
There are few things I could think of that are trivial, but might solve your problem. Maybe you changed JAVA_HOME in Path, or deleted it. Check for Environment Variables for JAVA_HOME.
Another thing is that you have Java 6 and you need Java 7. Or in your case, you need Java 7 x64. Maybe you have installed Java 7 x64, but JAVA_HOME points to another version of Java. Check for that too.
Ultimate solution is to write in eclipse.ini argument for desired virtual machine path, like:
-vm
/path/to/desired/java/vm
You can start eclipse with debug / console flag and see exactly what is happening
Run eclipsec.exe this will launch Eclipse with a debug console in the background.

Eclipse crashes at startup; Exit code=13

I am trying to work with Eclipse Helios on my x64 machine (Im pretty sure now that this problem could occur with any eclipse) but it just doesn't cooperate.
When I try to run eclipse I get the following:
I have installed
Helios EE x64 (latest version)
JDK 1.6.025 (x64)
I have linked my Environment Variables up correctly and tried to compile a Java file through cmd and have succeeded.
Whenever I tried running eclipse i get exit code=13 (required java version=1.5)
I tried running the following in cmd:
-vm "mypath\jdk1.6.025\jre\bin"
command as forums suggested
as well as other paths
-vm "mypath\jdk1.6.025\bin"
-vm "mypath\jdk1.6.025\jre\bin\javaw.exe"
even
-vm "mypath\jre6\bin" out of desperation
to no avail.
I am all out of ideas and I wonder if anybody had this problem. I even downloaded the helios x86 version and x86 JDK version yet it did not fix the problem. (I changed the environment variables)
I changed everything back but I'm stuck...
Related Question: Cannot Run Eclipse
It turns out that a directory had an ! in its name and eclipse had a problem with that.
Once I switched the directory (from Desktop which is located in the user directory which had ! in it to C:/ ) everything worked fine. (look at the Djava.class.path in the image located in my the question above for the whole path - it should make it clear what the problem was)
Vista allows you to create a username that contains ! character and then a lot of programs have issues with it
Update
If somebody is still getting this problem even though their path is ok I suggest
trying to look at the Environment Variables
then try uninstalling the Helios EE ( or any other version of ee you are running ) and JDK and then reinstalling the 86x versions of both (they should still work on the 64x platform).
for further explanation look here
Thank you everybody that tried to help
Please, check that your have downloaded the x64 version. ;)
And your installed Java, is x86. Use Eclipse x86 if you use Java x86.
Because your eclipse's env-arch was not matched with java-arch, for instance: eclipse-64bit run in java-32bit or vice versa.
In Windows: Set correct env path to the specific 32 or 64bit java acording to eclipse.
In Linux:
Try run: [path-to-eclipse]/eclipse -vm [jdk-path]/bin
What version of java is on your path when you start eclipse? Try entering java -version on a command prompt. You will want Sun java 1.5 or higher. See http://www.ehow.com/how_4784069_terminated-exit-code-error-eclipse.html
This turned out to be a permissions error for me. I change the kepler folder, eclipse root directory to have permissions set to everyone all. This is going to be a security risk so I will need to set the permissions to be program specific. using procmon.exe I found that javaw.exe was getting write permissions denied. The programmers of eclipse and javaw.exe did not give those programs elevated permissions to run as trustedinstaller.
I faced the same problem
Turned out my Java version in the PATH had been updated to 1.8
Once I changed this back to 1.7, my Eclipse started without issues

A JRE or JDK must be available in order to run Eclipse. No JVM was found after searching the following locations

Eclipse is unable to open, have used eclipse before and has open before without a problem. Now I keep getting the following error message:
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:
Have gotten eclipse to open and work on projects before and won't open.
Here is a screen shot of what I keep getting:
You can explicitly tell Eclipse where to find it. Open eclipse.ini and add the following lines to the top of the file:
-vm
/absolute/path/to/jre6/bin
Update: I just nailed down the root cause on my own Windows machine. The GlassFish installer complained with exactly the same error message and after digging in GlassFish forums, the cause was clear: a corrupt JRE install on a Windows machine. My JRE came along with the JDK and the Java 6 JDK installer didn't install the JRE properly somehow. A DLL file was missing in JDK's JRE installation. After I reinstalled the standalone JRE from http://java.com, overwriting the old one, the GlassFish installer continued and also Eclipse was able to start flawlessly without those two lines in eclipse.ini.
I got this problem because i uninstalled the jdk version 13 and reinstall the jdk version 8
Even though i have updated the path variables eclipse still pick the old configuration.
You need to edit the eclipse.ini file which is in your folder where eclipse.exe is placed.
Just update this file with the latest path so eclipse can pick it up
It usually is because:
you indicated the wrong jvm path in your -vm argument: see this SO question for an concrete example.
the eclipse.ini got corrupted somehow (if it hasn't been modified, this isn't it, but if setting a jvm path doesn't work, ... I would replace the eclipse.ini by one coming from a fresh installation just to be sure)
the java which eclipse search by default is no longer accessible (because the $PATH is no longer up-to-date)
More details on the wiki page "Finding a VM, Using JNI Invocation or Executing Java"
No -vm specified
When no -vm is specified, the launcher looks for a virtual machine first in a jre directory in the root of eclipse and then on the search path.
If java is found in either location, then we look for a jvm shared library (jvm.dll on window, libjvm.so on *nix platforms) relative to that java executable.
If a jvm shared library is found we load it and use the JNI invocation api to start the vm.
If no jvm shared library is found, we exec the java launcher to start the vm in a new process.
As mentioned in "FAQ How do I run Eclipse?":
Eclipse DOES NOT consult the JAVA_HOME environment variable.
So I would check your $PATH, starting by n new shell sesion (whatever your OS is), typing 'java -version' to see if it still returns anything.
Copy javaw.exe from C:\Program Files\Java\jre1.8(or)1.6(or)1.7\bin
and paste it inside Eclipse folder
where eclipse.exe is there. That's all.
Here is how I fixed mine:
find the location where your jre is installed. in my case, it was located at C:\Program Files\Java\jdk1.7.0_10
copy the jre folder and paste it where your eclipse files are located (where eclipse.exe is located).
when you download eclipse, you get a .zip package containing eclipse.exe and all the other files needed to run eclipse but it is missing the jre files. so all you need to do is to find where jre folder is located on your hard drive and add it to the rest of the eclipse package.
I had the same problem and the issue was that I had a 32 bit version of Eclipse running on my 64 bit machine and it wanted the 32 bit version of JRE.
I changed Program Files to Program Files (x86) in the eclipse.ini file like so:
-VM
C:Program Files (x86)\Java\jre6\bin
and that solved the problem.
You may want to just install the 64 bit Eclipse, but this will take care of the error.
Did you install Java via the java.com web browser auto install? If so, then that's your problem! You need to to the "manual" install: http://www.java.com/en/download/manual.jsp
It's just a matter of having the correct match of 32-bit Eclipse/32-bit Java or 64-bit Eclipse/64-bit Java. Many 64-bit Windows have 32-bit browsers and the latter is the version of Java that the auto-installer will provide - not what the 64-bit Eclipse wants.
Make sure the install path of JDK is in your Path variable in Windows.
adding -vm C:/Program Files/Java/jdk1.6.0_29/bin/javaw.exe to the .ini file helped me.
Is so simple,only add your java path for example:
C:\Program Files\Java\jdk1.8.0_121\bin
in PATH system variable
I have faced the similar issue earlier with Eclipse and STS IDE'S
Please check weather JDK/JRE is available or not in your machine. If not please install JDK and setup the environment variables.
Even after step 1, if you are still facing the issue then it's time to set the vm argument in eclipse.ini or sts.ini in the following way.
-vm
C:Program Files (x86)\Java\jre8\bin
I also had same problem when developing android applications using eclipse IDE.
I solved it by removing all the java installations (I had java 6 and 7 both) and re-install only jdk 7.
I got this fixed by doing the below steps,
1)
The eclipse finds the JAVA executables from 'C:\ProgramData\Oracle\Java\javapath'
The folder structure will contain shortcuts to the below executables,
i. java.exe
ii. javaw.exe
iii. javaws.exe
For me the executable paths were pointing to my (ProgramFiles(x84)) folder location
I corrected it to Program Files path(64 bit) and the issue got resolved
Please find the screenshot for the same.
Just to add on top of other answers:
Windows Users: You can give the PATH to JRE in eclipse.ini separated by '/' or '\'. It doesn't matter. Eclipse will pick it anyway. For example, in my windows system, either of the paths is fine (after -vm of course):
C:/Program Files/Java/jre1.8.0_181/bin
or C:\Program Files\Java\jre1.8.0_181\bin
Change the vm value in eclipse.ini file with the correct path to your JDK something like this,
-vm /Library/Java/JavaVirtualMachines/jdk-11.0.5.jdk/Contents/Home/bin
Path to eclipse.ini looks to me something like this,
/Users/tomcat/eclipse/jee-2018-09/Eclipse.app/Contents/Eclipse
This sometimes happen if you remove Java from your path variables.
To set the PATH variable again, add the full path of the jdk\bin directory to the PATH variable. Typically, the full path is:
C:\Program Files\Java\jdk-11\bin
To set the PATH variable on Microsoft Windows:
Select Control Panel and then System.
Click Advanced and then Environment Variables.
Add the location of the bin folder of the JDK installation to the
PATH variable in system variables.
I had this problem too on a win7 machine.
I wanted to update the jre with a jdk. So i deleted the jre folder and downloaded and unzipped the new jdk.
The issue was i manually deleted the jre folder, when instead i should've uninstalled it. This leaves a bunch of registry entries that still point to the old jre. Somehow eclipse still wants to use the old jre.
I couldn't uninstall the old java vm, i kept getting this error:
Error 1723. There is a problem with this Windows Installer package. A DLL required for this install to complete could not be run. Contact your support personnel or package vendor
So i had to use this MS utility to fix the uninstall:
http://support.microsoft.com/kb/2438651/
Then i had to install again the vm. I installed to the same location the original one was at, to avoid losing another hour! After that eclipse started correctly.
Julio
I just had this problem and fixed it this way. I noticed the error message has jre in it not jre6 or jre7, so i copied jre6 from program files to eclipse folder then renamed it from jre6 to jre, then it worked :p
Newb move on my part, but I had installed just the JRE instead of JDK. Installed JDK and my problem went immediately away.
I had this problem and it was due to my windows machine playing up. I went into control panel -> system -> advanced - environment variables.
I edited the PATH variable (which was already correctly set up), changed NOTHING, clicked OK to come back out of the screens.
Then eclipse worked. No idea why, except because windows. Hopefully this may help someone.
I had this issue; I fixed it by going to
Computer-->Properties-->Advanced Settings-->Environmental Variables
In the System Variables find the variable named PATH.
-->Select Edit
-->At the very end of the Path Variable, put a ";" then add your path of your JDK and put \bin\ at the end
Should be fixed.
Example:
System Variable-
C:\Program Files (x86)\Common Files.......HP\LeanFT\bin
JDK path-
C:\Programs Files\Java\jre1.8.0_121
Final Path -
C:\Program Files (x86)\Common Files.......HP\LeanFT\bin;C:\Programs Files\Java\jre1.8.0_121\bin\
Sources:
https://www.java.com/en/download/help/path.xml
Its simple.
JDK bin directory or JRE bin directory should be in path variable
Example :
Java Installed directory:
Assume your java installed in 'C:\Program Files\java\Jdk1.8.0_144' directory
Now you can find bin directory in 'C:\Program Files\java\Jdk1.8.0_144\bin'
Navigate to user's environment variable
Control Panel --> User Accounts --> User Accounts --> Change my environment variables
In popup click Path under User variables for section
Click Edit... button and another popup will appear
Click New button and enter C:\Program Files\java\Jdk1.8.0_144\bin
Click OK button and again OK button in Environment variables popup.
Now you can open your eclipse without error
I found a solution wherein the Eclipse.ini the location was the old version of Java, and after updating the new version of java the location of
-vm
C:\Program Files\Java\jre1.8.0_201\bin
was same so I had to change the directory to my new version of Java.
So solution is to just open the most updated Java version and copying its directory path and replacing it in the Eclipse.ini file.
Moderately future proof example for Linux-like systems. Assuming javac installed and on your path.
./eclipse -vm dirname $(readlink -f $(which javac))
This will find the directory where javac is installed, and pass as vm argument to eclipse.
If on Linux (ex: Ubuntu 18), try installing (or reinstalling in your case?) default-jre, as follows:
sudo apt update
sudo apt install default-jre
I had the same error when just trying to run the Eclipse installer (./eclipse-inst) on a fresh Eclipse download just now, and the installer wouldn't even run! Installing default-jre solved it!
Source:
https://linux4one.com/how-to-install-eclipse-ide-on-ubuntu-18-04/
In my case I had edited the eclipse.ini for a different purpose to include -vm parameter. That was causing the failure. I removed the -vm and following line where I had included \bin and that fixed the problem.
I got ERROR:
RESOLUTION :
in file eclipse.ini at below location :
make change as :
-vm
C:/Program Files/Java/jdk1.8.0_251/jre/bin/server/jvm.dll
Restart eclipse and error will be resolved
C:\Program Files\Java\jre1.8.0_221\bin
worked for me

Categories

Resources