Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

failed to create java virtual machine error in springsource tool?

Tags:

java

spring

I have downloaded springsource tool. But on install, it is giving me error "failed to create java virtual machine". Can anyone suggest me some solution?

This is my sts.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 com.springsource.sts.ide

--launcher.defaultAction openFile

--launcher.XXMaxPermSize 384M -vm C:\Program Files\Java\jdk1.6.0\bin\javaw.exe -vmargs

-Dosgi.requiredJavaVersion=1.5

-Xmn128m -Xms256m

-Xmx768m

-Xss1m -XX:PermSize=128m -XX:MaxPermSize=384m

like image 252
Akshay Avatar asked Aug 05 '11 16:08

Akshay


People also ask

How do I fix resolve could not create Java Virtual Machine in Mac?

To fix this, you will need to uninstall the problematic JDK version and install the latest one on your macOS machine: Run the /usr/libexec/java_home -V command to list all installed JVM versions.

How do you fix error could not create the Java Virtual Machine error a fatal exception has occurred program will exit?

Error: A fatal exception has occurred. Program will exit. You can try installing JDK 9 or any version later and check for java --version it will work. Save this answer.

What is virtual machine error in Java?

Signals that an unrecoverable error has occurred. Thrown to indicate that the Java Virtual Machine is broken or has run out of resources necessary for it to continue operating.


2 Answers

Find your sts.ini file usually in the root directory where you installed spring, try adding this as the first line in the file, make sure it points to YOUR JDK (You may need to change the path), also sometimes you need to put -vm and the path on different lines.

-vm C:\Program Files\Java\jdk1.6.0_20\bin\javaw.exe

My sts.ini

-vm
C:\Program Files\Java\jdk1.6.0_20\bin\javaw.exe
-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.1.R36x_v20100810
-product
com.springsource.sts.ide
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx768m
-XX:MaxPermSize=256m
like image 173
Kevin Bowersox Avatar answered Oct 07 '22 01:10

Kevin Bowersox


Today I had this problem with spring source tool and the resolution specified here worked better: Could not create the Java virtual machine

-Xmn128m
-Xms256m
-Xmx768m 
-Xss1m
-XX:PermSize=128m
-XX:MaxPermSize=384m

Reduced/changed max heap size to be same as MaxPermSize, and STS started without issues. -Xmx768m ---> -Xmx384m

Make sure your heap sizes are less than your RAM.

like image 3
jeera Avatar answered Oct 07 '22 01:10

jeera