我在我的系统上安装了Tomcat服务器(Windows XP)。 需要设置三个环境变量,即path , JAVA_HOME和CLASSPATH 。 但是对于Windows 8,需要设置另一个环境变量CATALINA_HOME 。
为何如此差异?
I was installing Tomcat server on my system (Windows XP). It was required to set three environment variables namely path,JAVA_HOME and CLASSPATH. But for Windows 8 , another environment variable CATALINA_HOME was required to be set.
Why this difference ?
最满意答案
基本上,Tomcat服务器4.x及更高版本由3个主要部分组成:Catalina(一个servlet容器),Coyote(一个HTTP连接器)和Jasper(一个JSP引擎)。 AFAIK,安装Tomcat(至少版本6,7,8), 无论 Windows操作系统(XP,7,8)如何,都包含以下步骤:
设置JAVA_HOME环境 变量 设置CATALINA_HOME环境 变量(这表示Tomcat安装的根,即显示servlet容器的位置) 更新PATH环境 变量%PATH%;%JAVA_HOME%\ bin;%CATALINA_HOME%\ bin我曾经使用过CLASSPATH环境错误地安装Tomcat。 变量。 来自oracle 文档的信息 :
CLASSPATH变量是告诉应用程序(包括JDK工具)查找用户类的一种方法。 (属于JRE,JDK平台和扩展的类应该通过其他方式定义,例如引导类路径或扩展目录。) 设置CLASSPATH可能很棘手,应该小心执行
Tomcat绝对不会与用户类耦合,并且不应该使用该变量进行安装。
Basically, Tomcat server 4.x and above consists of 3 main parts: Catalina (a servlet container), Coyote (an HTTP connector) and Jasper (a JSP engine). AFAIK, the installation of Tomcat (at least version 6, 7, 8), regardless of windows OS (XP, 7, 8), consists of the following steps:
setting JAVA_HOME env. variable setting CATALINA_HOME env. variable (This represents the root of your Tomcat installation i.e shows where servlet container is) updating PATH env. variable with %PATH%;%JAVA_HOME%\bin;%CATALINA_HOME%\binMy assamtion that you used to install Tomcat incorrectly using CLASSPATH env. variable. Info from the oracle docs:
The CLASSPATH variable is one way to tell applications, including the JDK tools, where to look for user classes. (Classes that are part of the JRE, JDK platform, and extensions should be defined through other means, such as the bootstrap class path or the extensions directory.) Setting the CLASSPATH can be tricky and should be performed with care
Tomcat is definitely not coupled with user classes, and one should not use that variable for its installation.
更多推荐
发布评论