Running Java and Eclipse From Your USB Flash Drive

Problem & Solution

If you work in different computers and some of them do not have the Java JDK & Eclipse IDE software, and/or you do not have administrator’s rights on the machine to change its configuration, you may want to install Java and Eclipse in a portable USB flash drive.

Next time you work on that machine, all you need to do is insert the USB flash drive, run a batch program to tell Windows to look first in your Flash dive for Java libraries, and execute Eclipse.

In the rest of these notes, we will assume E: representsthe location of the flash driver in your Windows machine (adjust if you have to).

Setup Steps (one time setup instructions)

  1. You need a USB Flash drive with approximately 500 MG (0.5 Gb) free to install both packages.
  2. Download and install Java-JDK in the flash drive (see instructions below)
  1. Download and install (unzip) the “Eclipse IDE for Java Developers” software in your flash drive
  1. You are almost done!.

Each time you run Java from your flash drive you need to:

(a)Run a DOSConsoleScreen (Start | run | type: cmd).

(b)Change directory location to your flash drive (type c> E:).

(c)Type in the following DOS command to temporarily adjust the Java class path variable

SetPath=java\jdk6\bin;%Path%

Perhaps it is more convenient to write this line in a batch program say myUSBjava.bat, next time instead of retyping the command you just execute myUsbJava.bat(see notes bellow)

  1. Run Eclipse (type e:>eclipse\eclipse)
  2. It is advisable to create an Eclipse Workspace in the flash drive, so your user created code and source files are saved in the same device where Java-&-Eclipse reside.

At this point you are done!. Your flash drive is ready to support your Java programming in any Windows machine.

CSU - CIS 260Page 1

JAVA SETUP

1. Push button: Accept >

2. This is a critical step! Push button: Change…

3. Folder Name: e:\Java\jdk1.6.0_18\

4. Push button: OK

5. Push button: Next >

6.Wait, this step could take several minutes

7. Push button: Finish

JAVA JDK has been installed.

CSU - CIS 260Page 1

Reminder

We assume you have already created a batch file in the (root) of the USB drive to redirect Java path. If not, use Notepad.exe to enter the file. Call it myUsbJava.bat. Put the following line in it:

E:\Java\jdk1.6.0_18\bin

Normal Operation – Using Your USB Flash Drive

Open a DOS ConsoleWindow(Start | run… | type in: cmd)

From the Windows Console enter the following commands:

E:
myUsbJava
eclipse\eclipse.exe

You should see a screen similar to the one below

You are ready to go.

CSU - CIS 260Page 1