Installation and configuration of JSP server

Source: Internet
Author: User
Tags variables variable tomcat

Download Address: http://java.sun.com/products/archive/j2se/1.4.2_06/index.html

First step:----Install J2SDK:

Download J2SDK installation files to the Sun official site (http://java.sun.com): j2sdk-1_4_2_04- Windows-i586-p.exe, download and install the J2SDK after installation, set environment variables: My Computer---attributes---advanced---environment variables;

Select---system variable (S):
 
To set the JAVA_HOME environment variable: Click---New, enter in the variable name: Java_home, enter in the variable value: D:\Java (if J2SDK is installed in the directory D:\Java, it is the J2SDK installation directory anyway.) Then---determine that the JAVA_HOME environment variable has been set up to this.

To set the CLASSPATH environment variable:

Click---New and enter in the variable name: CLASSPATH. Enter in variable values: D:\Java\bin;;D: \ Java\lib;d:\java\lib\dt.jar;d:\java\lib\tools.jar (Middle point number ".") and semicolon ";" Essential. Then---determine that the CLASSPATH environment variable has been set up to this.

To set the PATH environment variable:

Click---new, enter in variable name: PATH, enter in variable value: D:\Java;;D: \ Java\bin (Middle point number ".") and semicolon ";" Essential. )

Then---determine that the JAVA_HOME environment variable has been set up to this.

After the three environment variables are set, write a simple Java program to test whether the J2SDK has been installed successfully:

Create a new directory test under D:\, and then write the following program:
public class Test {
public static void Main (String args[]) {
System.out.println ("This are a test program.");
}
}

Save the above program as a file named Test.java, saved under the directory D:\test.

Then open the Command Prompt window, the CD to your test directory, and then type the following command

Javac Test.java
Java Test

At this point, if you see the print this is a test program, the installation is successful.

If you do not print out this sentence, you need to carefully check your configuration.

If the above J2SDK installation succeeds, continue with the Tomcat installation:

Step Two:----Install Tomcat:

To the Tomcat official site (http://www.apache.org/dist/jakarta/tomcat-4/) to download tomcat:

Jakarta-tomcat-4.1.30.exe, install after downloading. (for example, install under D:\Tomcat.) )

After installation, set environment variables: My Computer---attributes---advanced---environment variables;

Select---system variable (S):

To set the CATALINA_HOME environment variable:

Click---New, enter in the variable name: Catalina_home, enter in the variable value: D:\Tomcat, and then---OK, the catalina_home environment variable has been set up here. To set the CATALINA_BASE environment variable: Click---new, and enter in the variable name: catalina_base. Enter the value of the variable: D:\Tomcat, and then---OK, the catalina_base environment variable is already set up. Then modify the classpath in the environment variable and append the Servlet.jar under the Tomat installation directory to Classpath,

The modified classpath is as follows:

classpath=d:\java\bin;;D: \ Java\lib;d:\java\lib\dt.jar;d:\java\lib\tools.jar;d:\tomcat\common\lib\servlet.jar

Then you can start Tomcat, access http://localhost:8080 in IE, and if you see the Tomcat Welcome page, the installation is successful.



Related Article

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.