Java School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a Java Expert!

Join 298,476 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 2,781 people online right now. Registration is fast and FREE... Join Now!




Putting Java on Your Flash Drive

 
Reply to this topicStart new topic

> Putting Java on Your Flash Drive, Bring Java Anywhere!

iNaStY v3
Group Icon



post 5 Feb, 2008 - 01:43 PM
Post #1


Tired of installing the Java Runtime Environment on every computer you want to work on? Below is a tutorial showing how to install Java on a USB Memory Stick!

***System Requirements***
You will need a solid state USB disk drive with at least 200 MB capacity

***Step-By-Step How-To***
Before starting the steps below, plug in your USB drive and determine which drive letter it gets.

1. Start by opening your browser (which better be Firefox wink2.gif ) and go to Sun Microsystems and in the upper left hand corner of the screen, point your mouse to 'Java' and select (click) on 'Download the Latest JDK'

2. You will be redirected to a Java SE Downloads page, and we're interested in the first option (currently JDK 6 Update 4). Select the 'DOWNLOAD' link next to the name

3. Select the appropriate platform (should be Windows) and check the box agreeing to the License agreement

4. You will then be prompted to select the files you wish to download (I recommend the Offline Installation so you download the complete installation file and the rest of the installation process will go quicker. The other options download additional files during the installation process)

5. Download the file, saving it where you want (Desktop will do fine) and when finished, run the setup file.

6. After the installation initializes, select 'Run' and accept the License Agreement

8. Next you will be prompted to select the Directories you want to save the install files (again, the Desktop will be fine for now) then select 'OK' at the bottom of the Window. At the next screen you're taken to, Click the 'Start' Button

9. After that completes (about 10 minutes or so) accept the THIRD License Agreement

NOW PAY ATTENTION AND READ 10 AND 11 BEFORE CONTINUING

10. You will be taken to a 'Custom Setup' screen, allowing you to select the program features you want installed. Technically, the only one you actually need is the first option, 'Development Tools'. The other items listed below aren't needed and you can install them if you want.

11. Now, in that SAME WINDOW in the bottom right hand corner you'll see 'Change...' Select that and change the destination folder to your USB drive, and \jdk6 (or whatever you want to name the folder, I called it \Java)
IF YOU DON'T DO THIS JAVA WON'T INSTALL ON YOUR USB

12. When done, click 'Next' and let it install! (this will take some time)

***Set Up Your USB***
1. Open a DOS command window (either START -> Programs -> Accessories -> CommandPrompt or just START -> Run -> cmd)

2. In cmd, type k: and press enter (replace k: with the letter for your USB drive)

3.Type notepad.js.bat and press enter. A notepad window will appear. Click 'Yes' to create a new file

4. Type the following line into the notepad window:
CODE

set Path=\jdk6\bin;%Path%

replacing \jdk6 to whatever you named the folder in Step 11 above

5. Save the file and exit notepad

6. In the DOS window, type js and press enter (js is for java startup)

7. To see if the installation went ok, type javac . You should get a list of compiler options.

***THE INSTALLATION IS NOW COMPLETE!***

Please let me know if anyone has problems with this biggrin.gif
Go to the top of the page
+Quote Post


Register to Make This Ad Go Away!

skyhawk133
Group Icon



post 5 Feb, 2008 - 01:47 PM
Post #2
Nice tute and a great idea. I HATE downloading JRE everytime I get on a new box.


Vote for this tutorial on DZone if you found it useful: http://www.dzone.com/links/how_to_run_java...humb_drive.html
Go to the top of the page
+Quote Post

iNaStY v3
Group Icon



post 5 Feb, 2008 - 01:52 PM
Post #3
QUOTE(skyhawk133 @ 5 Feb, 2008 - 02:47 PM) *

Nice tute and a great idea. I HATE downloading JRE everytime I get on a new box.


Vote for this tutorial on DZone if you found it useful: http://www.dzone.com/links/how_to_run_java...humb_drive.html



thanks skyhawk! I was surprised not to find a tut like this on here already. I'm not sure if it work for other runtime enviornments, but I don't see why not. Plus, since you can buy a good 4 GB flash drive now for like $40 a couple hundred megs ain't no thang lol
Go to the top of the page
+Quote Post

skyhawk133
Group Icon



post 5 Feb, 2008 - 01:53 PM
Post #4
And, for submitting this tutorial, you've automatically been entered to win one of the DIC 1GB thumb drives... so they could be free wink2.gif
Go to the top of the page
+Quote Post

iNaStY v3
Group Icon



post 5 Feb, 2008 - 02:03 PM
Post #5
O baby! lol that sounds like a pretty sweet deal. I'll keep making more tuts as I learn more and more. The Tut and Code Snip part of this site is pretty amazing and extremely helpful
Go to the top of the page
+Quote Post

shrestha
*



post 8 Feb, 2008 - 07:18 AM
Post #6
Take a look at http://www.javalobby.org/articles/tomcat2go/ where you can put Tomcat AND JRE into a thumbdrive and run your application from it.
Go to the top of the page
+Quote Post

bhandari
Group Icon



post 8 Feb, 2008 - 10:33 PM
Post #7
Great tutorial. Easy to follow.
10/10 bigsmile.gif bigsmile.gif bigsmile.gif
Go to the top of the page
+Quote Post

austin101385
*



post 24 Mar, 2008 - 12:42 PM
Post #8
I have a 250GB Western Digital External Hard Drive I'm trying to perform this with. I am on my Dell Inspiron E1505 trying to use the cmd prompt and when I type in "F:" and press [enter], and then "notepad.js.bat" and [enter] I get a message that says 'notepad.js.bat' is not recognized as an internal or external command, operable program or batch file.

Any idea what this means? Thanks
Go to the top of the page
+Quote Post

Zalea
*



post 8 Sep, 2008 - 09:56 AM
Post #9
QUOTE(austin101385 @ 24 Mar, 2008 - 01:42 PM) *

I have a 250GB Western Digital External Hard Drive I'm trying to perform this with. I am on my Dell Inspiron E1505 trying to use the cmd prompt and when I type in "F:" and press [enter], and then "notepad.js.bat" and [enter] I get a message that says 'notepad.js.bat' is not recognized as an internal or external command, operable program or batch file.

Any idea what this means? Thanks


I found this tutorial, as well, and ran into the same problem. Step 3 says "Type notepad.js.bat and press enter. A notepad window will appear. Click 'Yes' to create a new file" and that will work, but it should be notepad js.bat with a space instead of a "." Hope this helps anyone else who had problems.
Go to the top of the page
+Quote Post

Unknown Hero
Group Icon



post 28 Sep, 2008 - 06:50 AM
Post #10
This will make portable java only for Windows and not for all Windows OS-es... confused.gif
Go to the top of the page
+Quote Post

aashu.dwivedi
*



post 22 Apr, 2009 - 08:50 AM
Post #11
it would be nice if you added a shell scrip to change path for linux guys too .
Go to the top of the page
+Quote Post

yogesh.kulkarni123
*



post 8 Jul, 2009 - 04:26 AM
Post #12
QUOTE(austin101385 @ 24 Mar, 2008 - 12:42 PM) *

I have a 250GB Western Digital External Hard Drive I'm trying to perform this with. I am on my Dell Inspiron E1505 trying to use the cmd prompt and when I type in "F:" and press [enter], and then "notepad.js.bat" and [enter] I get a message that says 'notepad.js.bat' is not recognized as an internal or external command, operable program or batch file.

Any idea what this means? Thanks


Just run "notepad js.bat" insted of "notepad.js.bat"
Go to the top of the page
+Quote Post


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 


Lo-Fi Version Time is now: 11/3/09 11:22PM

Live Java Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Java Tutorials

Reference Sheets

Java Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month