Fixing the “Failed to create the Java Virtual Machine” error on Eclipse startup on a Mac

June 19th, 2020

If you’re seeing this popup when you launch Eclipse itself, or the Eclipse installer on your macOS, this post is for you. First, there’s a bit more details on the Eclipse and JDK bug trackers. To fix this, you will need to uninstall the problematic JDK version and install the latest one on your macOS machine:

  1. Run the /usr/libexec/java_home -V command to list all installed JVM versions.
  2. Identify the problematic version of the JVM – in my case it was “14, x86_64: "Java SE 14" /Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/Home“.
  3. Delete that version – with something like “sudo rm -rf /Library/Java/JavaVirtualMachines/jdk-14.jdk/
  4. Install the latest matching JVM / JDK – at the time of this writing it is 14.0.1
  5. Verify that it appears in the list of installed JVMs with /usr/libexec/java_home -V
  6. If needed, point the Eclipse.app/Contents/Eclipse/eclipse.ini to the location of the newly installed JVM (-vm parameter)