Run Java IDE using JDK and JRE on USB Drive?
807599Feb 7 2007 — edited Feb 7 2007I'm using a custom Java IDE written in Java. I'd like to give my 10th grade students USB Drives with the JDK and the IDE pre-installed. I'd like the students to be able to shuttle their work back and forth from home to school without altering any pre-existing Java configuration on their home computer. Some parents are very touchy about installing anything that might change the behavior of existing applications, including any Java apps, so I'd like to keep everything local to the USB drive if possible.
As with other IDEs, this one lets me indicate the path to the compiler on the stick, which works fine, but the IDE itself is executing from a JRE on the computer if one already exists. I'm assuming that this is do to the settings of the JAVA_HOME environment variable. I'd like to launch this IDE with the JRE that's on the USB Drive instead of any pre-existing JRE that may be on the PC.
Could I simply create a batch file which temporarily sets JAVA_HOME to the root Java directory on the USB drive (e.g. D:\JDK6) and then invoke the IDE? Would this force the execution of the IDE using the JRE on the USB Drive?
The other tricky thing is that I won't know what the drive letter is of the USB drive since they are assigned dynamically, unless there's a way of determining the drive letter of the drive from which the batch file is being run and using that as a variable in the batch file.
Any guidance would be appreciated,
- John K