Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Portable JDK, Tomcat, and Eclipse (Windows)

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...

like image 570
knpwrs Avatar asked Jul 09 '10 22:07

knpwrs


Video Answer


2 Answers

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"
)
like image 195
Gareth Davis Avatar answered Oct 17 '22 20:10

Gareth Davis


I just saw this. It's 2012. Here's how I did it. Visit http://tgducusin.blogspot.com/2011/12/portable-eclipse-with-java-jdk-tomcat.html

like image 28
Thomas Ducusin Avatar answered Oct 17 '22 19:10

Thomas Ducusin