According to Eclipsepedia, you need to tell Eclipse the exact path to your JAVA executable. You cannot use JAVA_HOME or any other variable name in this file!
Here we are going to show you how to make Eclipse use your JAVA_HOME directory so that when new versions (one of the umpteen updates) of JAVA are installed, Eclipse just works!
Assumptions:
- You are using Windows Vista (or possible XP).
- You know the exact path to your Eclipse installation directory.
- You know the exact path of the JVM that your eclipse installation is utilizing.
- The variable JAVA_HOME is set up on your computer.
The next step is to enter the following command at the prompt:
mklink /D java %JAVA_HOME%
Basically, we are telling Windows to create a symbolic link from the eclipse home directory, to the JAVA_HOME directory and to call this link java. Windows uses a program called mklink to do this.The output from that command will should resemble something like:
For those of you curious to see what happens when I list the directory contents:
The final step is now to put our symbolic link in the eclipse.ini file. So open up the eclipse.ini file (you can create a backup first if you like) and look for the lines that look like:
-vm
C:\path\to\JAVA_SDK\bin\javaw.exe
C:\path\to\JAVA_SDK\bin\javaw.exe
and replace them with:
-vm
java\bin\javaw.exe
java\bin\javaw.exe
Remember, that you are editing 2 lines (the -vm is on one line, while the java\bin\javaw.exe is on another)!
To confirm that everything works as promised, save your eclipse.ini file and start up eclipse!
2 comments:
If u have spaces in your java_home url, it won't work.
You need to add "" around %JAVA_HOME%. Tested on Windows 7.
mklink /D java "%JAVA_HOME%"
And need to run cmd as admin, otherwise you get "insufficient privileges"
One more thing. I am using Springsource Tool Suite.
And placing -vm argument to the end of eclipse.ini (sts.ini in my case) won't work. I also found that it should be at the beginning of the .ini file.
Post a Comment