如何设置 eclipse.ini -vm 选项?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/905611/
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
How do I set the eclipse.ini -vm option?
提问by cometta
回答by cometta
My solution is:
我的解决办法是:
-vm
D:/work/Java/jdk1.6.0_13/bin/javaw.exe
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256M
-framework
plugins\org.eclipse.osgi_3.4.3.R34x_v20081215-1030.jar
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
回答by Mike B.
eclipse.ini file must have -vm
on the first line and a path on the second line. Don't try to put everything into one line!
eclipse.ini 文件必须-vm
在第一行和第二行的路径。不要试图将所有内容都放在一行中!
-vm
C:\Program Files\Java\jdk1.6.0_07\bin\javaw.exe
回答by richard
Anything after the "vmargs" is taken to be vm arguments. Just make sure it's before that, which is the last piece in eclipse.ini.
“vmargs”之后的任何内容都被视为 vm 参数。只要确保它在这之前,这是 eclipse.ini 中的最后一部分。
回答by Andrew Niefer
There is a wiki page here.
有一个wiki页面在这里。
There are two ways the JVMcan be started: by forking it in a separate process from the Eclipse launcher, or by loading it in-process using the JNIinvocation API.
JVM可以通过两种方式启动:通过在独立于 Eclipse 启动器的进程中分叉它,或者通过使用JNI调用 API在进程内加载它。
If you specify -vm
with a path to the actual java(w).exe, then the JVM will be forked in a separate process. You can also specify -vm
with a path to the jvm.dll so that the JVM is loaded in the same process:
如果使用-vm
实际 java(w).exe 的路径指定,则 JVM 将在单独的进程中分叉。您还可以指定-vm
jvm.dll 的路径,以便在同一进程中加载 JVM:
-vm
D:/work/Java/jdk1.6.0_13/jre/bin/client/jvm.dll
You can also specify the path to the jre/bin folder itself.
您还可以指定 jre/bin 文件夹本身的路径。
Note also, the general format of the eclipse.ini is each argument on a separate line. It won't work if you put the "-vm" and the path on the same line.
另请注意,eclipse.ini 的一般格式是每个参数在单独的行中。如果将“-vm”和路径放在同一行上,它将不起作用。
回答by Andrew Niefer
-vm
C:\Program Files\Java\jdk1.5.0_06\bin\javaw.exe
-vm
C:\Program Files\Java\jdk1.5.0_06\bin\javaw.exe
Remember, no quotes, no matter if your path has spaces (as opposed to command line execution).
请记住,无论您的路径是否有空格(与命令行执行相反),都不要使用引号。
See here: Find the JRE for Eclipse
请参阅此处:查找 Eclipse 的 JRE
回答by Daniel
My solution for UbuntuLinux:
我的UbuntuLinux解决方案:
-vm
/home/daniel/Downloads/jdk1.6.0_17/bin
-startup
plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.2.R36x_v20101019_1345
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-XX:MaxPermSize=256m
-Xms40m
-Xmx512m
回答by hypotechguy
I am not sure if something has changed, but I just tried the other answers regarding entries in "eclipse.ini" for Eclipse Galileo SR2 (Windows XP SR3) and none worked. Java is jdk1.6.0_18 and is the default Windows install. Things improved when I dropped "\javaw.exe" from the path.
我不确定是否发生了某些变化,但我只是尝试了有关 Eclipse Galileo SR2(Windows XP SR3)的“eclipse.ini”中条目的其他答案,但没有任何效果。Java 是 jdk1.6.0_18 并且是默认的 Windows 安装。当我从路径中删除“\javaw.exe”时,情况有所改善。
Also, I can't thank enough the mention that -vm
needs to be first line in the ini file. I believe that really helped me out.
另外,我对-vm
需要在 ini 文件第一行的提及表示感谢。我相信这真的帮助了我。
Thus my eclipse.ini file starts with:
因此我的 eclipse.ini 文件以:
-vm
C:\Program Files\Java\jdk1.6.0_18\bin
FYI, my particular need to specify launching Eclipse with a JDK arose from my wanting to work with the m2eclipse plugin.
仅供参考,我特别需要指定使用 JDK 启动 Eclipse,因为我想使用 m2eclipse 插件。
回答by hypotechguy
You have to edit the eclipse.ini file to have an entry similar to this:
您必须编辑 eclipse.ini 文件才能获得类似于以下内容的条目:
C:\Java\JDK.5\bin\javaw.exe (your location of java executable)
-vmargs
-Xms64m (based on you memory requirements)
-Xmx1028m
Also remember that in eclipse.ini, anything meant for Eclipse should be before the -vmargs
line and anything for JVM should be after the -vmargs
line.
还要记住,在 eclipse.ini 中,针对 Eclipse 的任何内容都应该在该-vmargs
行之前,而针对 JVM 的任何内容都应该在该-vmargs
行之后。
回答by activedecay
The JDK you're pointing to in your eclipse.ini has to match the Eclipse installation.
您在 eclipse.ini 中指向的 JDK 必须与 Eclipse 安装相匹配。
If you are running a 32- or 64-bit Eclipse, use a 32 or 64-bit Java JDK, respectively.
如果您运行的是 32 位或 64 位 Eclipse,请分别使用 32 位或 64 位 Java JDK。
回答by Bruno Alessi
I'd like to share this little hack:
我想分享这个小技巧:
A click on the Eclipse's icon indicated a problem with the JRE. So, I put this command in the destination field of the icon's properties:
单击 Eclipse 的图标表明 JRE 有问题。因此,我将此命令放在图标属性的目标字段中:
C:\...\eclipse.exe -vm c:\'Program Files'\Java\jdk1.7.0_51\jre\bin\javaw
Thinking that the "'" would solve the problem with the space in the path. That did not function. Then, I tried this command:
认为“'”可以解决路径中的空间问题。那不起作用。然后,我尝试了这个命令:
C:\...\eclipse.exe -vm c:\Progra~1\Java\jdk1.7.0_51\jre\bin\javaw
with success
成功