Running Java and Eclipse From Your USB Flash Drive

110 downloads 2027 Views 755KB Size Report
CSU - CIS 260. Page 1. Running Java and Eclipse From Your USB Flash Drive. Problem & Solution. If you work in different computers and some of them do not ...
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: represents the 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) http://java.sun.com/javase/downloads/widget/jdk6.jsp

3.

Download and install (unzip) the “Eclipse IDE for Java Developers” software in your flash drive www.eclipse.org

4.

You are almost done!. Each time you run Java from your flash drive you need to: (a) Run a DOS Console Screen (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 Set Path=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)

5.

Run Eclipse (type e:>eclipse\eclipse)

6.

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 260

Page 1

JAVA SETUP

5. Push button: Next > 1. Push button: Accept >

6. Wait, this step could take several minutes 2. This is a critical step! Push button: Change…

7. Push button: Finish 3. Folder Name: e:\Java\jdk1.6.0_18\ JAVA JDK has been installed. 4. Push button: OK

CSU - CIS 260

Page 2

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 Console Window (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 260

Page 3