jre和java,JAVA_HOME和JRE_HOME之间的区别

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

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.

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

解决方案

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.

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

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值