This doesn\'t work -vm %JAVA_HOME%/bin/javaw.exe
How can I replace %JAVA_HOME% with full path on windows 8 when path contains space (\"program files\" directory)
Even if your %JAVA_HOME% contains spaces, you can directly put entire string over there.
-vm
C:\Program Files (x86)\Java\jdk1.8.0_162\bin
Also, you don't have to specify javaw.exe in the path, just mention it till bin it will find javaw.exe in bin folder by itself. Just keep one thing in mind that the jdk version you provide should match with the eclipse version you are using.
If you are using a 64 bit java then download 64 bit Eclipse. If you are using a 32 bit java then download 32 bit Eclipse.
Have you tried it. Don't put everything in single line.
-vm
C:\Program Files\Java\jdk1.6.0_07\bin\
Need to put the folder that contains the javaw or java executable. Under Ubuntu 18 with eclipse 4.7.1 I was able to get it to run with:
-vm
/usr/lib/jvm/java-8-openjdk-amd64/bin
-startup
plugins/org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.500.v20170531-1133
-vmargs
-Xmx2G
-Xms200m
-XX:MaxPermSize=384m
If it doesn't work then please confirm you have added above lines before -vmargs
in eclipse.ini
.
if you are using mac, proceed with following steps:
Move to following directory:
/sts-bundle/STS.app/Contents/Eclipse
Add the java home explicitly in STS.ini file:
-vm
/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/bin
-vmargs
Make sure not to add all the statements in single line
I was facing the same issue but was unable to solve, until I try this:
-vm
Enter
C:\Program Files\Java\jdk1.6.0_07\bin\javaw.exe
I have Windows 8.1 and my JDK under "Program Files" as well. What worked for me was replacing the name of the folder by the 8-digit internal MS-DOS name.
-vm
C:/PROGRA~1/Java/jdk1.8.0_40/bin/javaw.exe
I realized what was going on after running this in cmd.exe
CD \
DIR P* /X
It returned...
<DIR> PROGRA~1 Program Files
<DIR> PROGRA~2 Program Files (x86)
So we can find out how to use a path containing spaces
The -vm
option must occur after the other Eclipse-specific options (such as -product
, --launcher.*
, etc), but before the -vmargs
option, since everything after -vmargs
is passed directly to the JVM. Add the -vm
option on its own line and the path to your JDK executable on the following line; e.g.
-vm
C:\Program Files\Java\jdk1.8.0_161\bin\javaw.exe
-vm
optionbin
directory, not to javaw.exe
When you don't specify a virtual machine in your eclipse.ini
file, you may think that the JAVA_HOME
environment variable is used, but this is not the case!
From FAQ_How_do_I_run_Eclipse#Find_the_JVM
Eclipse DOES NOT consult the JAVA_HOME environment variable.
Instead the Windows search path will be scanned.
Recommendation
You may think it is a good idea to use the search path, because it is flexible.
While this is true, it also has the downside that the search path may be altered by installing or updating programs.
Thus, I recommend to use the explicit setting in the eclipse.ini
file.
The reason why you should specify the bin
directory and not the javaw.exe
(as proposed by many other answers), is that the launcher can then dynamically choose which is the best way to start the JVM. See details of the launcher process for all details:
We look in that directory for: (1) a default.ee file, (2) a java launcher or (3) the jvm shared library.
You can verify which VM is used by your running eclipse instance in the Configuration dialogue.
In eclipse Oxygen go to Help - About Eclipse - Installation Details - Configuration
You will see which VM path eclipse has chosen, e.g.:
eclipse.vm=C:\Program Files\Java\jdk1.8.0_161\bin\..\jre\bin\server\jvm.dll