edit the file /applications/eclipse.app/contents/info.plist
there is a comment for use a particular jvm:
<!-- to use a specific java version (instead of the platform's default) uncomment one of the following options,
or add a vm found via $/usr/libexec/java_home -v -->
i met this problem with
eclipse-java-2020-03-m2-macosx-cocoa-x86_64, and opendjdk11. the latest eclipse installer at the moment also complained same error.
after i switched back to openjdk8, everything goes well...
for windows os:
- open eclipse.ini in the eclipse program folder
- add the below lines at the top of the file
path-to-java-bin\javaw.exe (for example: c:\program files\java\jdk-11.0.10\bin\javaw.exe)
delete all java folder inside /library/java
then install a new jdk from https://adoptopenjdk.net/
which will install at /library/java/javavirtualmachines/adoptopenjdk-8.jdk
then try reinstalling eclipse a
i had the same problem in my mac. here is my solution.
first: i've uninstall all the versions of jdk, because i've try a lot of options. to do this, you need to go to library/java/javavirtualmachines and delete all the folders.
second: install jdk 1.8 here is a link to download this version: jdk 1.8
third: install eclipse 2020-03 and thats all.
if you want to use jdk 14, you need to follow this steps:
- open eclipse
- go to help > install new software
- in the install window copy the following link in work with https://download.eclipse.org/eclipse/updates/4.15-p-builds/
now you have to change the options, go to preferences (command + ,) > java > compiler and search the version 14. before this step you need to install jdk 14 (link) perhaps eclipse would suggest you to change to the correct jres, for this you need to go to java > installed jres and add the correct version. when you click add you need to choose he jre type, in my case i use a macos x vm and standard vm, then you have to choose the directory (/library/java/javavirtualmachine/jdk-14/contents/home and click open you could give a jre name and finish eclipse will be restart and now you can use eclipse with java 14.
this works for me, i hope you have understood me.
go to /library/java/javavirtualmachines
delete all version except one in use.
install jdk 8 from brew work for me. you can get the instruction on installing jdk 8 from homebrew here how to install java 8 on mac
referring to marseille joseph https://www.eclipse.org/forums/index.php?t=msg&th=1102885&goto=1823113&#msg_num_13 this worked for me!
their solution didn't require uninstalling jdk14 or to editing the eclipse.ini file. instead, do this:
sudo rm /library/java/javavirtualmachines/jdk-14.jdk/contents/macos/libjli.dylib
sudo ln -s /library/java/javavirtualmachines/jdk-14.jdk/contents/home/lib/libjli.dylib libjli.dylib
i started facing the same problem in mac suddenly after updating to macos monterey, so i just did the following steps: then go to contents/eclipse/eclipse.ini file and open it with any text editor and you will see the following: add below line before -vmargs as shown in above image:
this below line will be different for all the users:
and you can just get this line copied to your clipboard using this command in terminal:
$ echo $(/usr/libexec/java_home)/bin/java | pbcopy
similarly will be for sts:
note: the error "failed to create the java virtual machine" also exists with eclipse 2020-03 (under some situations, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=561273) and it is not required to use java 8 (with eclipse 2020-03).
for the impatient:
you can run eclipse or the eclipse installer with a given vm without changing
eclipse.ini by starting it via a command line:
open terminal an run:
open pathtoeclipseinstaller/eclipse\ installer.app --args -vm /library/java/javavirtualmachines/nameofjdk/contents/home/bin
pathtoeclipseinstaller is the path of the folder where eclipse installer is located and
nameofjdk is the name of the folder with the jdk (11, 12, 13).
open downloads/eclipse\ installer.app --args -vm /library/java/javavirtualmachines/jdk-11.0.2.jdk/contents/home/bin
in the installer you may select the vm used by eclipse. use a compatible vm here and the installer will modify the
eclipse.ini for you.
to clarify this issue:
eclipse - say eclipse 2020-03 - runs with java 11, java 12, java 13, but does not run with java 14. it fails with the message "failed to create the java virtual machine". this happens for the installer and for eclipse itself.
you can download eclipse without the installer from here: https://www.eclipse.org/downloads/packages/
on macos, if you start a freshly installed eclipse, it will use the default jvm. the default jvm is obtained by running
/usr/libexec/java_home will find the installed jdk with the highest version as default. that is, if you have jdk 14 installed and run eclipse 2020-03, you will see this error.
summarising some other answers here, there are three options:
once you have removed jdk 14 from /library/java/javavirtualmachines/ the error will be gone.
if you like to have jdk 14 installed, start the installer with a different jdk via the command line
open path-to-eclipse-installer/eclipse\ installer.app --args -vm /library/java/javavirtualmachines/nameofjdk/contents/home/bin
you may edit the eclipse.ini (as suggested in other answers) to use a specific jvm.
for me, i had to edit the
eclipse-inst.ini file located here:
and add the path to my local java vm at the very top of the .ini file, which is here:
eclipse installer.app file is in a dmg, right click on it, and copy it, then paste it into another folder. then right click on that app file, and choose "show package contents", to get into the files inside the application.
if you've already got eclipse installed, and find it's throwing the same error, you could try a similar approach by editing the following file for eclipse:
on mac, you can get the full path you'd need to your java exe by running the following in a terminal, which will copy the path to your clipboard.
$ echo $(/usr/libexec/java_home)/bin/java | pbcopy
it took me some time to figure this out as well. the main takeaway was eclipse does not support sdk version 14 (as of eclipse 2020-03). that was not completely obvious to me.
install a supported version (i used homebrew to install sdk v8 🍺):
brew cask install adoptopenjdk/openjdk/adoptopenjdk8
if this is the only java version you have installed you should be fine and eclipse should open up. if that is not the case and you have another java version installed. you have to tell eclipse which version of java it should be using (see step 2).
tell eclipse which version to use by editing the
/applications/eclipse.app/contents/info.plistfile as described by juan ignacio barisich and brad parks. that being the version you installed in step 1.
nano /applications/eclipse.app/contents/info.plist # or open /applications/eclipse.app/contents/info.plist
<key>eclipse</key> <array> <string>-keyring</string> <string>~/.eclipse_keyring</string> <string>-vm</string> <string>/library/java/javavirtualmachines/adoptopenjdk-8.jdk/contents/home/jre/</string> </array>
disclaimer: please bare in mind that those were the steps i took to get eclipse running again. because i'm nowhere qualified to give a precise answer about this please take a look at the comments in case i got something wrong.
edit: see christian fries answer who pointed out that all java versions 8 to 13 are supported by eclipse.
- Eclipse - Failed to create the java virtual machine
- Can't install Eclipse - "Failed to create the Java Virtual Machine" on Mac
- Eclipse Failed to create the Java Virtual Machine
- Eclipse switch workspace causes Failed to create the Java Virtual Machine
- failed to create the java virtual machine eclipse
- Starting Eclipse results in Failed to create Java Virtual Machine
- ADT Eclipse: Failed to Create The Java Virtual Machine
- Eclipse Failed to create Java Virtual Machine after changing eclipse.ini file
- getting failed to create java virtual machine error everytime I try to open eclipse
- Eclipse error upon opening "Alert Failed to create the Java Virtual Machine"
- Eclipse intermittently fails to create the Java Virtual Machine
- Eclipse installation -"failed to create the java virtual machine" Mac OS Catalina
- Failed to create Java virtual machine using Eclipse
- "Error: Could not create the Java Virtual Machine Error: A fatal exception..." Shows error when I tried to launch Eclipse IDE 2019-06
- Eclipse results in Failed to create Java Virtual Machine
- Eclipse error: 'Failed to create the Java Virtual Machine'
- How to solve could not create the virtual machine error of Java Virtual Machine Launcher?
- Can not create java virtual machine popup message in eclipse
- Eclipse provides "Failed to create the Java Virtual Machine"
- It is failed to create Java Virtual Machine
- Mac OS Catalina "to open eclipse you need to install the legacy java se 6 runtime"
- Unable to launch eclipse on Mac - No Java virtual machine
- Spring Tool can't create the java virtual machine
- Failed to create Java Virtual Machine after updating. :(
- JBoss EAP 6.3 error :Could not create the Java virtual machine
- Eclipse error: could not create the Java Virtual Machine. A fatal exception has occurred. program will exit
- Install Java EE Developer Tool on Eclipse Luna in a virtual machine
- Eclipse - no Java (JRE) / (JDK) ... no virtual machine
- eclipse won't start - no java virtual machine was found
- How to create the pom.xml for a Java project with Eclipse
More Query from same tag
- Running and debugging Eclipse RCP as a Maven project
- GitHub & Eclipse - Issue in cloning
- pdf extracting with iText error occured
- Maven auto-clean on package
- How do I get to use variables from two different methods, in a new method?
- Google App Engine: Deployed Source doesn't have Local updates
- How to view exception details while debugging Android in Eclipse?
- file created using getRealPath gets created on .metada/.plugins folder not in WebContent project folder
- no ManiActivty.java, acticity_main.xml, nor R.java ( when creating new android application project )
- how to configure for test hbase program
- Eclipse running JUnit5 tests throw java.lang.SecurityException: class "org.hamcrest.Matchers"
- How to find Deprecated Alternatives in Eclipse?
- eclipse / aptana - text compare show code syntax highliging
- Any eclipse plug-in for intel fortran compiler?
- Maven/Eclipse plugin: easiest way to have new Maven project have dependency on legacy non-Maven project?
- FATAL EXCEPTION GLTHREAD 123
- In eclipse how to show exception message of debugger code executed in display window?
- boost thread+signals: mem_fn error, invalid use of non-static member function
- Yosemite recognize only 1.6.0.jdk even though I installed Java 8. I can't modify java_home
- Setting Eclipse CDT with cygwin 1.7 for gtest
- Joss & Struts issue. Where should I put the breakpoint?
- Is it possible to compile a simple Java code in Android Studio?
- Why am I getting an error for main method not being found when running an example program?
- Persistent undefined reference
- Android ADT Bundle Creates appcompat and I don't what
- Android device keeps disconnecting from adb / eclipse
- How do I convert a method's local variable or expression to a method parameter using Eclipse?
- Rest service in Java runs from Tomcat server but not inside Eclipse
- Simplex algorithm stuck in loop
- have IntelliJ IDEA refresh the project and detect changed files