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
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).
Click the \"Download\" button on the next screen to continue.
Save the installer file to your desktop.
Attach your flash drive into your computer. Note which drive letter is assigned to the drive.
Double-click the JDK installer icon on your desktop to launch the installation.
Read the License Agreement. Click \"Accept\" to accept the terms of the agreement.
Click on \"Development Tools\" to select it. Click \"Change\" to open a file chooser window.
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.
Double-click the new \"java\" folder to select it as the installation folder. Click \"OK\" to return to the installation screen.
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.\"
Click \"Next\" to start the installation.
Click \"Finish\" to finish the installation.
Open a Command Prompt window by clicking the \"Start\" button, and selecting All Programs > Accessories > Command Prompt.
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.
Type \"notepad js.bat\" on the command line and hit the Enter key. Notepad opens. Click \"Yes\" to create a new file.
Type the following in Notepad:
Save the file and close Notepad.
Type \"js\" on the command line and hit the Enter key. This sets the environment to use Java on the flash drive.
Test the installation by typing \"javac -version\" followed by the Enter key. The version information is output to the screen.
Use the Flash Drive
Attach your flash drive to a computer. Note the drive letter assigned to the flash drive.
Open a Command Prompt window.
Type the drive letter of your flash drive followed by a colon and hit the Enter key.
Type \"js\" on the command line and hit the Enter key.
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.