failed to create java virtual machine error in springsource tool? - java

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

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

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.

For anyone who may have a similar issue as myself, your path to javaw.exe may be different. My path turned out to be:
C:\Program Files (x86)\Common Files\Oracle\Java\javapath\javaw.exe
In the command line, run where java and use that path to javaw.exe

Combining these two lines worked for me also.
-vm
C:\Program Files\Java\jdk1.6.0_20\bin\javaw.exe

Today I had this problem with spring source tool and the resolution specified here worked better:
Reduced/changed max heap size to be same as MaxPermSize, and STS started without issues
-XX:PermSize=128m,
Xmx768m ---> -Xmx384m

Related

Java was started but returned exit code=1?

I recently updated java and came across this error... I've changed my eclipse.ini file to the
-vm
C:\Program Files (x86)\Java\jre7\bin\javaw.exe
Yet it still doesn't work... here is the whole ini file
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20140603-1326
-product
org.eclipse.epp.package.cpp.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-XX:-UseCompressedOops
-vm
C:\Program Files (x86)\Java\jre7\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.7
-Xms40m
-Xmx512m
Any solutions? I don't know what to do
Make sure the JAVA_HOME variable and path was set properly.
I added the below, which resolved this issue.
-vm
C:\Program Files\Java\jdk1.6.0_45\bin\javaw.exe
Make sure, that the -vm option occurs before the -vmargs command.
The error message points to a problem with your java Version. Do you have a JDK installed?
Try adding:
-vm
c:/wherever/java/jdk1.8.0_40/jre/bin/server/jvm.dll
to your eclipse.ini file, pointing to the JDK you want to use, and check that the required Java Verision is at least as new as your JDK. This is the path for a Windows system.
Discovered the issue thanks to #Goose.
My JDK version was somehow not working? A fresh installation of Java and JDK seemed to resolve the issue as well as the rerouting of the ini file to:
-vm
c:/wherever/java/jdk1.8.0_40/jre/bin/server/jvm.dll
i have removed the same path which is displaying in error message from system environmental variables [ In "Path" Variable]

Debugging in Eclipse on MacOS X slow - anything that I can do?

on my Mac debugging in Eclipse is extremly slow. With slow I mean stepping through the code. Every step (even if it is only multiline string-concatenation) takes about 1-2 seconds. When I compare that to eclipse running on Windows, that is just painful!
I'm using Eclipse Kepler with Sun JDK 1.7.0_45 (as Eclipse Runtime and Program Runtime). Switching to Apple JDK 6 did not change that much. Is there anything that I can do about that?
Edit:
What I'm trying to do is to debug a local application using Debug As > Java Application.
My eclipse.ini is looking like this:
-startup
../../../plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
-vm
/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/bin/java
--launcher.library
../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.200.v20130807-1835
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dorg.eclipse.swt.internal.carbon.smallFonts
-Dorg.eclipse.swt.browser.IEVersion=10001
-Dosgi.requiredJavaVersion=1.6
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-XX:MaxPermSize=512m
-Xms40m
-Xmx2048m
-Xdock:icon=../Resources/Eclipse.icns
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
Increase the amount of memory for your JVM. Open eclipse.ini from the following path:
Eclipse.app/Contents/MacOS/eclipse.ini
. Edit the following variables like so. Replace 1.6 with your version of Java.
-Dosgi.requiredJavaVersion = 1.6
-Xms128m
-Xmx1024m
The actual problem was a little bit unexpected: In the eclipse.ini there were two settings:
--launcher.XXMaxPermSize
256m
and
-XX:MaxPermSize=512m
For some reason eclipse preferred the 256m MaxPermSize setting. After changing that line to 512m everything works nice and fast. sigh software development tooling can be boring. Thanks for any responses to this question!
Remove all breakpoint definitions once and then restart it by adding the ones you need only.
Sometimes Eclipse is getting out of synch with some of its internal/displayed state.

Eclipse Failed to create the Java Virtual Machine

I'm using eclipse to develop android application and it always gone well, but today it's giving problems.
When i try to open eclipse it show me this message "Failed to create the java virtual machine. Error occurred during initialization of VM. Could not reserve enough space for object heap"
This is my eclipse.ini
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20120913-144807
-product
com.android.ide.eclipse.adt.package.product
--launcher.XXMaxPermSize
256M
-showsplash
com.android.ide.eclipse.adt.package.product
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.8
-Xms1336m
-Xmx1336m
-Declipse.buildId=v22.3.0-887826
-XX:MaxPermSize=512M
I tried to change "256m" in "512m" but it still doesn't work. I tried to restart but nothing. I tried to change the -XX:MaxPermSize=512M value, but nothing.
Just add your JDK path in windows environment variable.
Open eclipse.ini and change the following variables.
For -Dosgi.requiredJavaVersion=1.8, try changing your required Java version to 1.6.
Memory-related defaults (as of Eclipse 3.4):
-Xms40m
-Xmx256m
-XX:MaxPermSize=256m
Recommended settings for Android development:
-Xms128m
-Xmx512m
-XX:MaxPermSize=256m
If everything else fails you can just delete or rename eclipse.ini and let the IDE handle everything. I strongly suggest looking for a current replacement for your eclipse.ini and reading up on how to configure the eclipse.ini for Android development.
Closed all the other memory intensive application in my windows7. And tried to
open eclipse. This worked for me, and I found it on similar question here Stackoverflow-eclipse failed to create JVM.

On starting eclipse, it gives an error "Java was started but returned exit code=13"

I am trying to start eclipse after installing java 7 and adding the line
-vm
C:\Progra~2\Java\jdk1.7.0_45\bin\javaw.exe
to the eclipse.ini file. Still i am getting the error "Java was started but returned exit code=13".
I just want to know how to start eclipse. Even if i have to install eclipse, java, jre all over again.
Any suggestion will do!
My eclipse.ini file:
-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_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
C:\Progra~2\Java\jdk1.7.0_45\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
On pasting the jre in eclipse folder i am getting this error:
All you have to do is to put the new jdk path in eclipse.ini
-vm
C:\Program Files\Java\jdk1.8.0_11\bin\javaw.exe
or the your new jdk path.
make sure that you type the above just before the -vmargs and after the OpenFile
that solved my problem
Check that you have installed the correct java that your OS requires. Meaning, if you are running a 64 bit OS then you need 64 bit java and the same for 32 bit.
Check eclipse.ini file, and in particular format of the vm option (look here for more):
Note the format of the -vm option - it is important to be exact:
The -vm option and its value (the path) must be on separate lines.
The value must be the full absolute or relative path to the Java executable, not just to the Java home directory.
The -vm option must occur before the -vmargs option, since everything after -vmargs is passed directly to the JVM.
Another thing to check is that bit version (32/64) of JVM should match bit version of eclipse (32/64).

Can't make eclipse open even after change eclipse.ini

I'm trying to change eclipse.ini file to add -vm C:\Program Files\Java\jdk1.7.0\bin\javaw.exe
in order to get rid of the error:
java runtime environment JRE or java development kit must be available
in order to run eclipse. No java virtual machine was found after
searching in the folloiwng location
But the error still persists, am I doing something wrong?
-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_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 C:\Program Files\Java\jdk1.7.0\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
According to this Eclipse document:
Note the format of the -vm option - it is important to be exact:
The -vm option and its value (the path) must be on separate lines.
The value must be the full absolute or relative path to the Java executable, not just to the Java home directory.
The -vm option must occur before the -vmargs option, since everything after -vmargs is passed directly to the JVM.
Note the first requirement. So, try using this somewhere in your .ini file:
-vm
C:\Program Files\Java\jdk1.7.0\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
Note: this is obviously a fragile way to enforce .ini file syntax, and I believe a later version of Eclipse has fixed this potential problem. But, looking at your file, you seem to have a May 2011 build, and if it's not working, I'd try following the .ini document strictly.
try use the same values for:
-Xms and -Xmx
example:
-Xms384m
-Xmx384m
this works for me

Categories