Eclipse JVM configuration

允我心安 提交于 2019-11-27 20:39:06
VonC

See:

for an example of parameters order.

-vm should be before -vmargs


Update 6 years laters (2015)

E Riz mentions in the comments that the new Eclipse Installer will detect the JVM for you, or propose ones to download.

Jeremy Goodell

Unbelievable, the solution to this problem for me has nothing to do with slashes, backslashes, quotes, spaces, jre, jdk, jvm, javaw, ....

The answer is that you have to have a line break between -vm and the path.

So in the eclipse.ini file:

THIS WILL NOT WORK:

-vm C:\java\jdk\bin\javaw.exe

BUT THIS WILL:

-vm
C:\java\jdk\bin\javaw.exe

I think your machine is 64bit windows?

I cannot see a 64bit windows version of eclipse in the site. So only 32 bit might be available. Are you sure you have a 32bit JDK installed in your machine? Just a thought...

This also addressed in Eclipse documentation: https://wiki.eclipse.org/Eclipse.ini#-vm_value:_Windows_Example

Abhijeet

If you're using Windows, right click on your eclipse shortcut and select Properties, in the Shortcut tab you can change what's in the Target: box to specify the jdk. I use

"C:\Program Files\eclipse-jee-galileo-sr1 (3.5.1)\eclipse.exe" -vm "C:\Program Files\Java\jdk1.6.0_16\bin\javaw.exe" -vmargs -Xmx1024m -XX:PermSize=256M -XX:MaxPermSize=512M -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode For some reason I couldn't get it to use the jdk when I tried editing the eclipse.ini file.

Howto start eclipse in JDK?

My issue was that -vm "C:\Program Files\Java\jdk1.7.0_67\jre\bin\javaw.exe"

the path was in quotes, when i removed the quotes it worked:

-vm C:\Program Files\Java\jdk1.7.0_67\jre\bin\javaw.exe

You should mention the full path of javaw.exe after -vm argument without using double quotes, i.e. "", each of -vm and the path has to be in different lines and -vm must be before -vmargs. For example:

-vm
C:\Program Files\Java\jrockit-jre1.6.0_45-R28.2.7\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Xms40m
-Xmx512m
-XX:+UnlockDiagnosticVMOptions
-XX:MaxClassBlockMemory=75M
z8888q

I solve this question.

When you create a Maven Project in Eclipse maybe the text file encoding in this project's properties and the project.build.sourceEncoding in the pom.xml was not the same. When you build this project it would report "Unable to locate the Javac Compiler in:..." error, too.

For example, my text file encoding was GBK and project.build.sourceEncoding was UTF-8 so this error happened. I just modified the text file encoding to UTF-8.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!