Meanings of system environment variables configured during tomcat installation

Source: Internet
Author: User
The meaning of system environment variables configured during tomcat installation-Linux Enterprise applications-Linux server application information. The following is a detailed description. You must configure the system environment variables when installing tomcat! What are environment variables? Why do we need to configure environment variables?

For example:

JAVA_HOME = d: \ j2sdk1.4.0 (JDK installation directory)
TOMCAT_HOME = d: \ Apache Tomcat 4.0 (Tomcat installation directory)

Why is it written like this?

When installing jdk, write it as follows:

Path = % path %; d: \ j2sdk1.4.0 \ bin
Classpath =.; d: \ j2sdk1.4.0 \ lib \ tools. jar

Why?

Answer:

Jdk and tomcat are free web Server SETUP platforms developed by sun and apache. Jdk support is required for web development using tomcat (because tomcat is a typical jsp/servlet container support. Jsp/servlet is developed by sun ). When you click the webpage, the browser sends a request to the tomcat server. tomcat understands and calls the jar packages and api functions of jdk and the jar packages called by tomcat's jasper compiler when running jsp. These calls are called according to the environment variable path correctly set in the system environment variable. If the configuration is incorrect, your application cannot be implemented. Another method is to add environment variables: in win2000 and winxp, right-click "my computer" and choose "properties", then click "advanced", and then select "environment variables" here, in the following (there are 2 boxes), click Create and enter JAVA_HOME in the "variable name". Enter d: \ j2sdk1.4.0 in the variable and then confirm. Others do the same. After completing these configurations, enter javac in the "command prompt" and press enter to see if the help of the javac compiler is available. If so, the jdk configuration is correct. Run startup. bat (tomcat \ bin \ startup. bat) and then the dos window does not disappear. It means that your tomcat configuration is okay. Enter http: // localhost: 8080/in ie and a cat's webpage appears, then you can configure OK! There are a lot more to configure for her.

What are environment variables? Why do we need to configure environment variables?

This is a bit interesting. The simplest understanding is to replace absolute paths with environment variables so that some applications can be transplanted on different systems or terminals, you do not need to modify the application, for example:

Defined

JAVA_HOME = d: \ j2sdk1.4.0 (JDK installation directory)

TOMCAT_HOME = d: \ Apache Tomcat 4.0 (Tomcat installation directory)

Then you can use % JAVA_HOME %, % TOMCAT_HOME % (under MS windows) or $ JAVA_HOME, $ TOMCAT_HOME to replace the above two absolute paths, these variables are required for server startup and application deployment.

When installing jdk, write it as follows:

Path = % path %; d: \ j2sdk1.4.0 \ bin
Classpath =.; d: \ j2sdk1.4.0 \ lib \ tools. jar

Why?

This problem is relatively simple. For both windows and linux systems, if the path system environment variable is registered, some executable programs such as javac and java under the bin directory are raised in the command line, instead of getting the Directory d: \ j2sdk1.4.0 \ bin (or/usr/local/j2sdk1.4.0/bin), you can directly use these commands in any path.

As for the classpath environment variable, it is to allow the java Virtual Machine to find the class introduced in the java program (the import command is used in the java program). In fact, you can see what the classpath name means. Note that ".;" here "." indicates the current path.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.