Monday, January 09, 2006

Eclipse and Java on USB Memory Stick

I bought myself a memory stick a few days ago, mainly to store data which I download in a internet coffee shops. I find it quite annoying to transport my laptop every time I just would like to read some mails...

Somehow I found portableapps.com which has a nice collection of tools (Firefox, Thunderbird, etc.) which can be copied on the USB memory stick and started from there. This makes it easy to use my favorite browser and mail client...

For me the next question was: can I install Eclipse and Java on the memory stick and use it? Yes, you can :)

Here a short description on what I did:

1.) Copy a current installation of Java to the memory stick. I really copied it, I didn't install it!
2.) Copy Eclipse on the memory stick.
3.) Write a simple batch file to start Eclipse.

that's it!

My directory structure on the memory stick looks like this:

%USB_MEMORY_STICK_ROOT%
| Eclipse.bat
+---Applications
+---jdk1.5.0_05
| \---bin
| \---javaw.exe
|
+---eclipse
\---eclipse.exe

Eclipse.bat looks like this:

.\Applications\eclipse\eclipse.exe
-data .\Projects
-vm .\Applications\jdk1.5.0_05\bin\javaw.exe
-vmargs -Xmx256M



Enjoy :)

3 comments:

Jasper van den Bosch said...

This sounds a bit too good to be true.. Any problems sofar? Would this work on Linux too? Perhaps with a separate batch file pointing to the linux Java.

I'm definitely going to try this some time, since reinstalling your environment every now and than takes up so much valuable time..

Anonymous said...

This sounds like exactly like what I was looking for.

Ideal for situations where there's lots of desktop sharing :-)

If it works under windows I bet it works under Linux as well.

You don't have to install Eclipse to run it. You can just copy your folder and run the eclipse.exe to make it work.
But I guess you should copy your workspace as well.

Do you know a way to synchronise your (workspace) files from the USB stick with your Laptop, just to make sure you are working in the right file versions?

Perhaps via SVN?

If yes, is it possible to use the same account (username and password) then or should the laptop and USB stick both have their own account?

I'm gonna try this one soon ;)

cheers,

Marcel

Jhon said...

Hi ! I'm trying to make Java run on my key, so I've got some questions :
- What versions/pack of Java & Eclipse did you use to do that ?
- Does it work on PC where no Java is installed ? I'm quite surprised it worked, because I tried something similar (installing a JDK directly on the usb key then modifying the path & classpath of the pc), but it didn't worked :(
- Is it really important to copy the install instead of installing on the key ?

Thanks for replying :)

Jhon