JAVA:JDK environment variable Configuration +TOMCAT environment variable configuration

Source: Internet
Author: User
Tags apache tomcat

One: JDK
1. Install the JDK first
To view the JDK version:
Doc under Input java-version
2. Configure Environment variables (add system variables)
Java_home D:\study\jdk-6\jdk-6 (JDK installation path)
CLASSPATH.; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar; (Note the front is a bit.)
Path (original, there is no new)%java_home%\bin;%java_home%\jre\bin;
3. Test in the Doc Command Line window input Javac, get helpful information is successful

Problems you may encounter: environment variables are well configured, running Javac useless
Environment variables can be set using the set path in cmd:
Set path (take path as an example) = (Copy the contents of path in the system variable) and run


Note:

1,. Represents the current path,%java_home% is referring to the previously specified java_home;

2,java_home indicates the JDK installation path, which includes folders such as Lib,bin,jre, Tomcat,eclipse, and so on, which need to be dependent on this variable.

3,path allows the system to identify Java commands under any path.

4,classpath is the Java load class or lib path, only the class is in Classpath and the Java command is recognized.



II: Tomcat environment variable configuration [PS: Can not configure the TOMACT environment variables, some projects use their own tomcat, which is configured here may cause the default to use this and then not run up]

1, new variable name: catalina_base, variable value: C:\tomcat

2, new variable name: catalina_home, variable value: C:\tomcat

3, open path, add variable value:%catalina_home%\lib;%catalina_home%\bin

start the Tomcat service
    1. Methods two kinds:

1, method One: Enter the command under the cmd command: Startup, the following dialog box appears, indicating that the service started successfully.

2, method Two: Right click on the desktop "My Computer", "Management", "services and Applications", "services", find the "Apache Tomcat" service, right click on the service, select "Properties", the "Startup Type" from "Manual" to "automatic".
Test Tomcat

      1. Open the browser, enter http://localhost:8080 carriage return in the address bar, and if you see a JSP page from Tomcat, your JDK and Tomcat have been successfully built.


        Precautions:

        The path in 1,java_home cannot end with a semicolon, such as C:\Program files\java\jdk1.7.0.

        The path in 2,catalina_base,catalina_home,tomcat_home cannot end with "\".

        The path of the 3,java_home must not be written as the path to the JRE.

        4, in the environment variables to modify the addition of variables, be sure to pay attention to semicolons, spaces, whether there are extra letters. The author is not successfully configured because there is one more letter in the path. If the configuration is unsuccessful, be sure to check again and again.

        Above error, very prone to error: Catalina_home or java_home is not configured well. If the error "The CATALINA_HOME environment variable is not defined correctly"









        --

JAVA:JDK environment variable Configuration +TOMCAT environment variable configuration

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.