How to Install Java on a Flash Drive

by Deborah Lee Soltesz

If you use multiple computers, having a portable flash drive full of your favorite software is a handy way to carry around your workspace. This is particularly useful if you frequently work on public computers in libraries or school computer labs where you may not have permission to install the software packages you need. Installing Java on a flash drive lets you create your own portable software environment, ensuring you have access to the version of Java you need.

Install and Configure

1

Visit the Java Downloads page (see Resources). Click the \"Download\" link for the latest version of the Java Platform, Standard Edition JDK (Java Development Kit).

2

Click the \"Download\" button on the next screen to continue.

3

Save the installer file to your desktop.

4

Attach your flash drive into your computer. Note which drive letter is assigned to the drive.

5

Double-click the JDK installer icon on your desktop to launch the installation.

6

Read the License Agreement. Click \"Accept\" to accept the terms of the agreement.

7

Click on \"Development Tools\" to select it. Click \"Change\" to open a file chooser window.

8

Click the \"Look in\" menu to open it. Select your flash drive from the list. Click the \"New Folder\" button (sparkly folder icon), type \"java\" for the new folder name, and hit the Enter key.

9

Double-click the new \"java\" folder to select it as the installation folder. Click \"OK\" to return to the installation screen.

10

Click on each of the remaining listed components (Demos and Samples, Source Code, etc.), hit the \"Change\" button, select the \"java\" folder on your flash drive, and click \"OK.\"

11

Click \"Next\" to start the installation.

12

Click \"Finish\" to finish the installation.

13

Open a Command Prompt window by clicking the \"Start\" button, and selecting All Programs > Accessories > Command Prompt.

14

Type the drive letter of your flash drive followed by a colon (for example, \"x:\") and hit the Enter key to change the current working drive to the flash drive.

15

Type \"notepad js.bat\" on the command line and hit the Enter key. Notepad opens. Click \"Yes\" to create a new file.

16

Type the following in Notepad:<br /><br />set Path=\\java\\bin;%Path%

17

Save the file and close Notepad.

18

Type \"js\" on the command line and hit the Enter key. This sets the environment to use Java on the flash drive.

19

Test the installation by typing \"javac -version\" followed by the Enter key. The version information is output to the screen.

Use the Flash Drive

1

Attach your flash drive to a computer. Note the drive letter assigned to the flash drive.

2

Open a Command Prompt window.

3

Type the drive letter of your flash drive followed by a colon and hit the Enter key.

4

Type \"js\" on the command line and hit the Enter key.

Items you will need

About the Author

Deborah Lee Soltesz is a web developer who has been creating websites, promotional materials and information products since 1992. Soltesz has a Bachelor of Science in computer science and engineering. She worked in earth and space science research writing for scientific and general audiences for more than a decade.

More Articles