I have Eclipse 3.5.1 and Java Portable (from Portableapps.com) installed on a portable hard drive and would like to point my Eclipse to use the portable apps Java version. This will allow me to use Eclipse on a computer even if Java isn't installed. How do I accomplish this?
3 Answers
Perhaps take a look at the Eclipse Portable project on SourceForge
EDIT: Alternatively, edit the eclipse.ini file and add:
-vm
..\path-to-jre\bin\javaw.exe
[The new line after -vm matters]

- 123,847
- 25
- 243
- 454
-
I've been following their progress, but don't want to use anything that's not "official" for my day job. Once it officially hits and I can be sure it's stable and works well I'll definitely be using it. – PHLAK Oct 16 '09 at 23:48
-
Just noticed your edit. Will try this tomorrow and see how that works. Thanks. – PHLAK Oct 19 '09 at 07:06
-
Adding "-vm ..\path-to-jre\bin\javaw" to eclipse.ini doesn't seem to have any effect. Any other ideas? – PHLAK Oct 23 '09 at 04:57
-
Adding "-vm ..\path-to-jre\bin\javaw" as an argument worked, but I am unable to get this to work with my portable apps menu. Any thoughts? – PHLAK Oct 24 '09 at 00:54
-
I'm assuming you are replacing "..\path-to-jre" with the actual relative path to the potable JRE, right? – Amro Oct 24 '09 at 01:30
-
Yes, I'm specifying the path, not just copy/pasting. – PHLAK Oct 27 '09 at 23:03
-
As stated in the wiki, you must NOT use quotes around the path when using the .ini file. Perhaps that was the problem? – Amro Oct 27 '09 at 23:22
-
Guess I'm just going to have to wait for Eclipse Portable to be officially released then. – PHLAK Dec 10 '09 at 15:58
I know it's been ages since this post has been active, but I might have three additional details to contribute (at least they seemed to be crucial in my case):
- Just as stated here, paths need to be separated by
/
, not\
ineclipse.ini
At least on MS Windows 7 (64 bit), it seems to be very important that you put the
-vm ../path-to-jre/bin/javaw.exe
at the very beginning of theeclipse.ini
file and that it is actually two lines:-vm
../path-to-jre/bin/javaw.exe
Otherwise Eclipse seems to first try to find
C:\Windows\System32\javaw.exe
which will cause an error (at least my error log says so)- Seems that the following path (found here) also works:
../path-to-jre/bin/server/jvm.dll
As of 2013-04-19 for Eclipse 4.2.2 (Juno), this is how my eclipse.ini
looks like:
-vm
c:/jre/Java64/bin/javaw.exe
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20120913-144807
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Xms40m
-Xmx512m
Note that /Java64/bin/javaw.exe
is taken from portable java

- 12,762
- 7
- 71
- 120
Open Eclipse.
Navigate to Window > Preferences > Java > Installed JREs
Add the JRE on your portable hard drive
Set this as your default JRE.

- 2,129
- 16
- 20
-
Is the the Java path it uses to RUN Eclipse? The description in the menu states "...the checked JRE is added to the build path of newly created Java projects". That doesn't sound like what I'm trying to accomplish. – PHLAK Oct 16 '09 at 23:53
-
Indeed, I misunderstood. I'm guessing @amro's solution of modifying the .ini file may have some merit for your case. – Jon Quarfoth Oct 17 '09 at 00:23