简体   繁体   中英

Eclipse - Failed to create the java virtual machine

I'm having issue with running my Eclipse with the following config:

eclipse.ini

-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.100.v20110502
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256M
--launcher.defaultAction
openFile
-vm
jdk1.7.0_02/bin
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Xms256M
-Xmx1024M

# Adding this line, I get "Failed to create virtual machine"

-XX:PermSize=512M
-XX:MaxPermSize=512M
-XX:+UseParallelOldGC
-XX:ParallelGCThreads=2
-XX:ThreadPriorityPolicy=1
-Xverify:none
-XX:-UseSplitVerifier

The above configuration works except when I add the lines I specified above. What could be the problem?

I am running eclipse from a Windows 7 (64-bit) machine with 4GB ram, although the JDK I specified in the path is 32-bit which works just fine. The only problem is if I add those additional config parameters.

There are two place in eclipse.ini that includes

--launcher.XXMaxPermSize
256m

make it

--launcher.XXMaxPermSize
128m

I had exactly the same problem, one day eclipse wouldn't open. Tried editing eclipse.ini to the correct java version 1.7, but still the same error. Eventually changed :

-Xms384m 
-Xmx384m

...and all working.

将MaxPermSize = 512M更改为MaxPermSize = 256M后对我有用

Change the below parameter in the eclipse.ini (which is in the same directory as eclipse.exe) to match one of your current Java version. Note that I also changed the maximum memory allowed for the eclipse process (which is run in a JVM). If you having multiple Java versions installed this can be happen. The below trick word for me.

-Xmx512m
-Dosgi.requiredJavaVersion=1.6

I cahanged this to,

-Xmx1024m
-Dosgi.requiredJavaVersion=1.7

Then It worked...

将内存减小到Xmx512m,即可使用。

Change the below parameter in the eclipse.ini (which is in the same directory as eclipse.exe) to match one of your current Java version. Note that I also changed the maximum memory allowed for the eclipse process (which is run in a JVM). If you having multiple Java versions installed this can be happen. The below trick word for me.

-Xmx512m
-Dosgi.requiredJavaVersion=1.6

I changed this to,

-Xmx1024m
-Dosgi.requiredJavaVersion=1.7

Then It worked.

I deleted my eclipse.ini after non of the above worked for me.

I fully expected the next run (when it looked likely to work) to recreate it so I could compare but it did not.

So I can't tell what fixed it specifically.

an oddity I did have however was jdk 1.7 but when I ran

C:\\Users\\jonathan.hardcastle>java -version Registry key 'Software\\JavaSoft\\Java Runtime Environment\\CurrentVersion' has value '1.7', but '1.6' is required. Error: could not find java.dll Error: could not find Java SE Runtime Environment.

i got the above.. so I (re?)installed jre 1.7 specifically and that went away.

This was not linked to my eclipse success directly.

--launcher.XXMaxPermSize MaxPermSize=256m -Xms512m -Xmx1024m

 replace with below one

--launcher.XXMaxPermSize MaxPermSize=128m -Xms256m -Xmx512 m

You can also try closing other programs. :)

It's pretty simple, but worked for me. In my case the VM just don't had enough memory to run, and i got the same message. So i had to clean up the ram, by closing unnecessary programs.

Just add your JDK path in windows environment variable. This solves in my case

在此处输入图片说明

I had the same problem, I've fixed it very simple by updating my JDK version. If you don't have JDK installed or not updated, please Go here and install/update it. Mostly your problem will be fixed.

In my case reducing Xmx1024m to something smaller eg Xmx512m make it works. So from all the responses (above and in similar other sites), it seems that you may try to massage/reduce the memory size.

I have added below line and its working fine.

-vm C:/Program Files/Java/jdk1.6.0_16/bin/javax.exe

-Xmx512m

-Dosgi.requiredJavaVersion=1.6

You can do a workaround as below:

Create a shortcut for eclipse and right click on the short cut and go to properties of the shortcut.

In the target box update the string:

-vm "C:\Program Files\Java\jdk1.6.0_07\bin"

the path will change according to your java installed directory.

So after changing the target string will be something like below.

D:\adt-bundle-windows-x86-20131030\eclipse\eclipse.exe -vm "C:\Program Files\Java\jdk1.6.0_07\bin"

Click apply and try clicking the Eclipse shortcut.

Try to open eclipse.ini and replace

-Xmx1024m

with

-Xmx512m

My java version is 1.7 as you can see below

-Dosgi.requiredJavaVersion=1.7

so i didn't modify that parameter.

This worked for me ;-)

For me it was a memory issue. If I run tomcat with my (large) webapp then try to start Eclipse, I get the Eclipse error. If I start Eclipse first, then start tomcat and my webapp, all works as expected.

Recently i encounter this issue and try all of the above method but none of them works for me.

Here is another Trick for to solve this error is

i just delete the eclipse configuration file and eclipse start working.. i don't know why but it works.

Maybe this helps someone else.

If Anybody Is using prior version then Jdk 8 update 20 and getting this Issue Please Remove the following from eclipse.ini file

-XX:+UseStringDeduplication

As StringDeduplication was added in later version of JDK 8 in update 20 For StringDeduplication Clarification check this By Fabian Lange https://blog.codecentric.de/en/2014/08/string-deduplication-new-feature-java-8-update-20-2/

I had also entered the path of MinGW complier for C++. After removing it, the error disappeared.

I tried several methods but didn't work. The only one that did is the one right at the bottom. I'll just list the other options I tried as well, for reference.

Some background, I migrated from Mars to Neon and copied over eclipse.ini almost exactly.

Reduce -XX:MaxPermSize and -Xmx

Like other answers have mentioned, progressively reduce these 2 flags (eg to 128m) and try again. If it still doesn't work at 128m then try other options below.

Find the offending flag by renaming eclipse.ini

Jon H's answer gave me a hint. Delete eclipse.ini (or rename it) and start eclipse. It should regen eclipse.ini and launch successfully (mine didn't regen eclipse.ini though eclipse launched fine).

If eclipse.ini did regen for you, then add each flag back one-by-one.

If not, revert the original eclipse.ini and remove each flag one-by-one until you've found the flag that causes an error.

For my case, I upgraded from Mars to Neon. The offending flag was -XX:+UseG1GC Removing this flag (and only this flag) worked for me. Setting back -Xmx and -XX:MaxPermSize to 1G worked for me as well.

从文件中删除-XX:+ UseParallelOldGC选项后,它对我有用

Change target to specific installation file
like below
Target: D:\\SoftWares\\oepe-12.1.3.1-luna-maf-distro-win32-x86_64old\\eclipse.exe -vm D:\\delete\\jdk1.7.0_67\\bin\\javaw.exe

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM