user2533283
user2533283

Reputation: 47

Eclipse error upon opening "Alert Failed to create the Java Virtual Machine"

I just downloaded eclipse, and when I open it I am getting an error "Alert Failed to create the Java Virtual Machine".

I have tried solutions that others have posted here but none seem to work. I also have Java version 1.7.

Here is my eclipse.ini file as well.

Thanks in advance for any help!

-startup
../../../plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
--launcher.library
../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.200.v20140603-1326
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.7
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-XX:MaxPermSize=256m
-Xms40m
-Xmx512m
-Xdock:icon=../Resources/Eclipse.icns
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts

Upvotes: 1

Views: 1200

Answers (2)

eckes
eckes

Reputation: 10433

I would add an explicite path to a compatible Java App:

-vm
/Library/Java/JavaVirtualMachines/jdk1.7.0_xx.jdk/Contents/Home/bin/java
-vmwargs
...

You must add the -vm lines before the existing -vmargs lines.

Modify the path to match your installed java, you can run java_home to find out. It needs to match the architecture of the Eclipse native parts.

Upvotes: 2

SachinKakkar
SachinKakkar

Reputation: 85

I found a solution. And it has been solved on my computer if you are using mac and JDK 11+ with STS or Eclipse follow these steps:

step1. rename libjli.dylib

cd /Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/MacOS sudo mv libjli.dylib libjli.dylib.bak

step2. create linked file for libjli.dylib sudo ln -s ../Home/lib/libjli.dylib libjli.dylib

step3. restart Eclipse.

This should be a bug for Eclipse and should be fixed in the next version of Eclipse.

Upvotes: 0

Related Questions