便携式 JDK、Tomcat 和 Eclipse (Windows)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3216902/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Portable JDK, Tomcat, and Eclipse (Windows)
提问by knpwrs
Does anybody know how to make a usb thumb drive with a JDK, Tomcat, and Eclipse (J2EE) (all for a Windows platform, preferably)?
有谁知道如何使用 JDK、Tomcat 和 Eclipse (J2EE)(最好都用于 Windows 平台)制作 USB 拇指驱动器?
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?
我知道 eclipse 部分会很容易——只需将它放在拇指驱动器上。据我所知,Tomcat 需要一个 JDK。有没有办法设置 tomcat,使其始终引用拇指驱动器上的 jdk(而不是使用系统 JAVA_HOME 变量)?日蚀呢?
I'm thinking something like cygwin would clearly be overkill...
我在想像 cygwin 这样的东西显然有点矫枉过正......
采纳答案by Gareth Davis
tomcat is pretty easy.
tomcat 很简单。
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.
有一个叫标准的批处理文件setenv.bat
中<tomcat-dir>/bin
这是由所谓的catalina.bat
,你可以设置此引用了JDK的相对路径。
An example of doing this is the liferaytomcat distrabution, have a look at it's setenv.bat
file.
这样做的一个例子是liferaytomcat distrabution,看看它的setenv.bat
文件。
liferay 6.0.1 setenv.bat
checks for a JRE installed in the CATALINA_HOME
directory:
liferay 6.0.1setenv.bat
检查安装在CATALINA_HOME
目录中的 JRE :
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"
)
回答by Thomas Ducusin
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
我刚看到这个。现在是 2012 年。这是我如何做到的。访问http://tgducusin.blogspot.com/2011/12/portable-eclipse-with-java-jdk-tomcat.html