views:

64

answers:

1

Does anybody know how to make a usb thumb drive with a JDK, Tomcat, and Eclipse (J2EE) (all for a Windows platform, preferably)?

I saw this question, but the only answer was speculative.

I know that the eclipse part would be easy -- just put it on the thumb drive. Tomcat requires a JDK as far as I know. Would there be a way to setup tomcat so it always references a jdk on the thumb drive (rather than using the system JAVA_HOME variable)? How about Eclipse?

I'm thinking something like cygwin would clearly be overkill...

+1  A: 

tomcat is pretty easy.

There is a standard batch file called setenv.bat in <tomcat-dir>/bin which is called by catalina.bat you could set this up to reference a relative path for the JDK.

An example of doing this is the liferay tomcat distrabution, have a look at it's setenv.bat file.

liferay 6.0.1 setenv.bat checks for a JRE installed in the CATALINA_HOME directory:

if exist "%CATALINA_HOME%/jre1.5.0_22/win" (
    if not "%JAVA_HOME%" == "" (
    set JAVA_HOME=
    )

    set "JRE_HOME=%CATALINA_HOME%/jre1.5.0_22/win"
)
Gareth Davis
Thanks for those tips! Any clue or leads on the JDK? I know eclipse can work with a JRE, and if Tomcat can as well I could use this: http://portableapps.com/apps/utilities/java_portable
npsken
err.. just copy sun's jdk directory whole after install there it can be copied and moved with out problems (except maybe for browser plugin's but there is unlikely to be your issue)
Gareth Davis