Difference between JAVA_HOME and JRE_HOME

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-17 18:15:47

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/11120279/difference-between-java-home-and-jre-home

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!