Running Eclipse on a machine without Java

As “portable applications” are getting more and more popular, it is important to say that Eclipse has always been portable: just unzip it anywhere and run it. The real issue is not having Java Runtime Environment installed on the machine where you want to run Eclipse. Unfortunately, installing Java on Windows requires full administrator rights.

I decided to create my portable Eclipse distribution on an USB hard drive (a Western Digital Passport) instead of an USB pen drive. The latter would be impractically too slow to support applications that require  handling thousands of files.

There is no portable Java for Windows yet (shame on Sun, I mean, Oracle). But it is known that an existing Java installation on Windows may be copied anywhere, like an USB hard drive. This copy will work with some minor adjustments (like manually setting path to the java/bin directory). On Linux things are much easier, since the Java installer just extracts the content anywhere and does not require administrator permissions.

This is what I did. First I installed the most up to date Java Runtime Environment on my Windows XP machine (or virtual machine if you don’t want to waste a physical machine for Windows). Then I unzipped Eclipse on the USB hard drive. As expected, Eclipse was not able to find the Java Runtime Environment installed on the same USB hard drive. That was very easy to fix by just editing the eclipse.ini file to point to the Java copy that is on the same disc.

Here is how the directories are organized on the USB hard drive. Just to avoid problems, do not use directory names with spaces.

WD Passport (F:)

And that is how the eclipse.ini file looks like:


There is just one issue, however: Each Windows machine mounts the USB drive as an arbitrary drive letter. Today I manually edit the eclipse.ini file if the USB drive letter changes. The only solution I imagine would be a script that rewrites the eclipse.ini file whenever the drive letter changes.

2 Responses to Running Eclipse on a machine without Java

  1. Davi says:

    You don`t need to change anything. Just rename the JRE folder to “jre” and put it inside eclipse folder.

    Eclipse laucher looks for this folder before quering the configured JRE or system JAVA_HOME.

    Also this works for your RCP application as well.



  2. Diogo says:

    It is also possible (in Windows) to use the absolute drive path, this way there is no problem if the pendrive gets assigned a different drive letter:

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: