java 在springsource工具中创建java虚拟机失败报错?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6959712/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
failed to create java virtual machine error in springsource tool?
提问by Akshay
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?
我已经下载了 springsource 工具。但是在安装时,它给了我错误“无法创建java虚拟机”。谁能建议我一些解决方案?
This is my sts.ini
这是我的 sts.ini
-startup plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
-启动插件/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.100.v20110502
--launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.100.v20110502
-product com.springsource.sts.ide
-product com.springsource.sts.ide
--launcher.defaultAction openFile
--launcher.defaultAction openFile
--launcher.XXMaxPermSize 384M -vm C:\Program Files\Java\jdk1.6.0\bin\javaw.exe -vmargs
--launcher.XXMaxPermSize 384M -vm C:\Program Files\Java\jdk1.6.0\bin\javaw.exe -vmargs
-Dosgi.requiredJavaVersion=1.5
-Dosgi.requiredJavaVersion=1.5
-Xmn128m -Xms256m
-Xmn128m -Xms256m
-Xmx768m
-Xmx768m
-Xss1m -XX:PermSize=128m -XX:MaxPermSize=384m
-Xss1m -XX:PermSize=128m -XX:MaxPermSize=384m
回答by Kevin Bowersox
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.
通常在安装spring的根目录中找到您的sts.ini文件,尝试将其添加为文件中的第一行,确保它指向您的JDK(您可能需要更改路径),有时您还需要将-vm 和不同行上的路径。
-vm C:\Program Files\Java\jdk1.6.0_20\bin\javaw.exe
My sts.ini
我的 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
回答by jeera
Today I had this problem with spring source tool and the resolution specified here worked better: Could not create the Java virtual machine
今天我在使用 spring 源工具时遇到了这个问题,这里指定的解决方案效果更好:无法创建 Java 虚拟机
-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
将最大堆大小减少/更改为与 MaxPermSize 相同,并且 STS 启动时没有问题。-Xmx768m ---> -Xmx384m
Make sure your heap sizes are less than your RAM.
确保您的堆大小小于您的 RAM。
回答by Ninad Pingale
Combining these two lines worked for me also. -vm C:\Program Files\Java\jdk1.6.0_20\bin\javaw.exe
结合这两行也对我有用。-vm C:\Program Files\Java\jdk1.6.0_20\bin\javaw.exe
回答by Suresh Kappati
Today I had this problem with spring source tool and the resolution specified here worked better:
今天我在使用 spring 源工具时遇到了这个问题,这里指定的分辨率效果更好:
Reduced/changed max heap size to be same as MaxPermSize, and STS started without issues
将最大堆大小减少/更改为与 MaxPermSize 相同,并且 STS 启动没有问题
-XX:PermSize=128m, Xmx768m ---> -Xmx384m
-XX:PermSize=128m, Xmx768m ---> -Xmx384m
回答by stackSean
For anyone who may have a similar issue as myself, your path to javaw.exe may be different. My path turned out to be:
对于可能与我有类似问题的任何人,您的 javaw.exe 路径可能不同。我的路径原来是:
C:\Program Files (x86)\Common Files\Oracle\Java\javapath\javaw.exe
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
在命令行中,运行where java
并使用 javaw.exe 的路径