JAVA_HOME和JRE_HOME之间的区别 [英] Difference between JAVA_HOME and JRE_HOME

查看:765
本文介绍了JAVA_HOME和JRE_HOME之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个启动Tomcat的脚本,它看起来像这样:

I have a script that starts Tomcat and it looks like this:

rem set JRE_HOME=C:\Program Files\Java\jdk1.7.0_03
set JRE_HOME=C:\Program Files\Java\jre7\
set CATALINA_HOME=D:\test\Server\apache-tomcat-6.0.18
"%CATALINA_HOME%\bin\catalina.bat" jpda start



<我可以将JRE_HOME设置为我的jre文件夹或我的JDK文件夹,Tomcat也可以工作,但是如果我删除JRE_HOME并使用JAVA_HOME,Tomcat只有在我给它JDK文件夹的路径时才能工作。

I can set JRE_HOME to either my jre folder or my JDK folder and Tomcat will work, but if I remove JRE_HOME and use JAVA_HOME instead, Tomcat will only work if I give it the path to the JDK folder.

那么JRE和JAVA home之间有什么区别,为什么Tomcat会以这种方式运行?

So what is the difference between JRE and JAVA home, why does Tomcat behave in this manner?

推荐答案

如果您使用完整的JDK运行,Tomcat会在启动时启用一些其他调试选项。这些选项需要JDK,因此如果您声称要确保这些选项在使用时不会失败,Tomcat会检查您实际上是否正在使用它。

Tomcat enables some additional debugging options at start up if you are running with a full JDK. These options require the JDK so you Tomcat checks you are actually using one if you claim that you are to ensure these options don't fail if used.

我很少看到这些正在使用的选项。我想我已经使用过一次与Tomcat一起工作了10年。

I rarely see these options being used. I think I have used them once in getting on for 10 years working with Tomcat.

当你使用JRE_HOME时,Tomcat没有启用JDK特定的选项,所以它不会检查如果你使用完整的JDK而不是JRE运行。

When you use JRE_HOME Tomcat doesn't enable JDK specific options so it doesn't check if you are running with the full JDK rather than the JRE.

这篇关于JAVA_HOME和JRE_HOME之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆