score:213
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
.
score:-9
Reinstall java and choose a destination folder without a space
score:-3
-vm C:\Program Files\Java\jdk1.6.0_07\bin\javaw.exe
score:0
Try to escape the space with back slash.. Like
C:\program\folder\ \name\java\jdk\bin
score:0
Go to C drive root in cmd Type dir /x This will list down the directories name with ~.use that instead of Program Files in your jdk path
score:0
Sometimes spaces in path create a problem. You can add e.g. -vm C:\progra~1\Java\jre1.8.0_112\bin\javaw.exe
score:1
Windows-vm "C:\Program Files\Java\jdk1.6.0_07\jre\bin\javaw.exe"
score:1
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
score:2
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.
score:4
Solution in:How do I set the eclipse.ini -vm option?
-vm C:\\bin
-vm
C:\<java_path>\bin
Must be the first thing in eclipse.ini
score:4
All above answers didn't work for me. My Eclipse mars is x64 but I need to set registry dll to x86 for another software.
At the end I put -vm argument at the end of shortcut and this did the trick.
D:\mars\eclipse\eclipse.exe -vm "C:\Program Files\Java\jre7\bin\server\jvm.dll"
According to this doc jvm.dll also work for some cases.
score:6
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
score:10
I was facing the same issue but was unable to solve, until I try this:
- Please make sure you put
-vm
- Then press
Enter
- And then paste
C:\Program Files\Java\jdk1.6.0_07\bin\javaw.exe
score:23
tl;dr
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
Details
Notes
- The path is on a new line below the
-vm
option - There is no need to escape any characters or use slashes (back-slashes are fine)
- The path points to the
bin
directory, not tojavaw.exe
Gotcha JAVA_HOME
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.
Finding a VM
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.
Verfication
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
score:57
Add the entry of vm above the vm args else it will not work..! i.e `
-vm C:\Program Files\Java\jdk1.7.0_75\bin\javaw.exe --launcher.appendVmargs -vmargs -Dosgi.requiredJavaVersion=1.6 -Xms40m -Xmx512m
Source: stackoverflow.com
Related Query
- How to specify jdk path in eclipse.ini on windows 8 when path contains space
- How to specify the order of class members when formatting in Eclipse
- How to specify arguments when starting Android emulator in Eclipse (to wipe data)
- How to automatically change Eclipse build path when I check out Git branches
- How do I step into JDK source code when debugging remotely in Eclipse
- Windows 7 64, Eclipse 64, JDK 64 and specified DSN contains an architecture mismatch
- How to change default build directory path in Eclipse CDT when "Generate makefiles automatically" is enabled?
- How to find out which JDK (not JRE) an installation of Eclipse on Windows is using
- How to config maven pom.xml when my don't want src/test/java present in my eclipse java build path source category when update project?
- how to execute c program in windows command prompt when run from eclipse cdt
- How to start Eclipse when Windows 10 starts
- How to specify CLIENT when doing SQL SELECT statement against a Calculation View in Eclipse HANA View?
- How do I specify an old JDK compliance in an Eclipse project?
- eclipse how to add the windows which contains my functions
- How to make a jar in Eclipse that contains HTML files that need to run when the jar is started?
- How to specify path to property files in Eclipse via Run Configurations?
- How to reference libraries in jdk without hardcoding path in Eclipse project file?
- How do I set default file path location in windows builder eclipse (java)
- How to specify command line arguments for my C program when running it from the Eclipse IDE
- How to create qt application in eclipse cdt when qt plugin not working in windows
- How do I retain git history and project location in eclipse on windows when moving from 2 drives to 1?
- How can I bind sources of 3rd party jar to eclipse for debugging when jar is not on the class path
- How to output messages to the Eclipse console when developing for Android
- How to configure Eclipse build path to use Maven dependencies?
- How to open windows explorer on selected resource in Eclipse
- How to make Eclipse behave well in the Windows 7 taskbar?
- How to change JDK version for an Eclipse project
- Eclipse can't find XML related classes after switching build path to JDK 10
- How to reference javadocs to dependencies in Maven's eclipse plugin when javadoc not attached to dependency
- How do I run Eclipse using Oracle's new 1.7 JDK for the Mac?
More Query from same tag
- Background drawable is not displaying in real device
- Programmatically activating existing label decorator from another plugin
- Android Eclipse Helios
- Changing Eclipse's server IP address
- Primefaces Dialog - Setter not found for property class
- Compiling with ANT using external libs
- SQLite SELECT gives exception How to fix it?
- Spring Tool Suite: Copying and renaming a Maven Web App
- How to specify and read properties in an Eclipse plugin
- eclipse memory analyzer doesn't open
- Dialogflow v2 Java Client Library detectIntent with Spring Boot on Eclipse
- Eclipse plugin to suggest replacements for deprecated feature warnings
- EclipseRCP - Update menu items programmcatically
- Reverse Display for Eclipse
- Android - Empty PreferenceFragment after HoloEverywhere update
- Inspecting android sql database from Eclipse
- How to create files/folders in java DynamicWebApplication?
- Maven not adding jars to classpath
- Visual SVN Checkout error
- Can't find Oracle Database Driver in Eclipse JAVA Program
- Eclipse: Stop on NotANumber
- How to resolve "java.lang.UnsatisfiedLinkError: no AspriseOCR in java.library.path.."
- Copyright symbol "©" is invalid?
- Eclipse Plugin Fails to Load
- JSON libs for Eclipse
- How to use xml contents in web service by SOAP method on android/eclipse
- EMF Eclipse: enumeration with custom fields (properties)
- What happens if I modify class in project while application is still running?
- Quickblox: Sample won' start
- How do I get Eclipse to default to the right font size in SQL Windows on the Mac