JSP environment variable configuration
1. Configure JDK
First, download JDK from the sun website.
Double-click jdk-rj5_0_04-windows-i586-p.exe to start installation. The default installation is C:/program files/Java/jdk1.5.0 _ 04. You can also change the path, but remember the last path selected, we also need to use it when setting environment variables (C:/JDK is recommended. It is convenient to do anything in this way. My personal opinion, haha). After JDK is installed, JRE will be installed, installed together.
After the installation is complete, we can start to set the environment variables. Right-click my computer and select Properties, advanced, and environment variables.
Click new in the system variable column. The create system variable dialog box is displayed. In variable name (N), enter java_home. In variable value (V) enter the path you selected when installing JDK, for example, C:/JDK/jdk1.5.0 _ 04.
After confirming, create another environment variable in the system variable (s) column, enter classpath in the variable name (n), and fill in the variable value (V .; % java_home %/lib/DT. jar; % java_home %/lib/tools. jar.
Find and select the path option in the system variable (s) column, click Edit, and add at the end of the variable value (V); % java_home %/bin;
Confirm and exit. So far, our environment variables have been set.
Small Java codes can be compiled.ProgramTest the following. Open notepad, enter the following applet, and save it as helloworld. java.
Public class helloworld {
Public static void main (string [] ARGs ){
System. Out. println ("Hello, world! ");
}
}
Run cmd, go to the directory where helloworld. Java is located, and run
Javac helloworld. Java
Java helloworld
If you can output Hello, world! The environment variable is successfully set.
2. Configure Tomcat
Download Tomcat from the official website for free. It is up to 6.0;
Click "Install" and select the directory to be installed. I installed it in C:/tomcat 5.5. You can set it by yourself. Right-click my computer, select attribute, advanced, environment variable, and click New in system variable (s). The create system variable dialog box is displayed. In variable name (N), enter tomcat_home, enter the path you selected when installing Tomcat in the variable value (V), for example, C:/tomcat 5.5.
Find and select the classpath option in the system variable (s) column. Click Edit and add % tomcat_home %/common/lib at the end of the variable value (V; confirm and exit. So far, our environment variables have been set.
Start the Tomcat server, open the browser, and enterHttp: // localhost: 8080/If you see the Tomcat image, it is successful.