Q:

How do I set the Java path in Eclipse so I can run it on an external drive? 

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? 

A:

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]

A:

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 \ in eclipse.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 the eclipse.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

