Turn http://www.cnblogs.com/pannysp/archive/2012/03/07/2383364.html
1. Download the JDK, install
Official website: http://java.sun.com/javase/downloads/index.jsp
After downloading, install, select the directory you want to install the JDK to:
For example: JDK installation directory: E:\java
Other Boven said to install the JRE, in fact, the JDK installed, you do not need to install the JRE, itself has.
2. Setting the JDK environment variable
Right-click on "Computer", click "Properties", click "Advanced System Settings" in the left part of the popup screen, select "Advanced" tab, click "Environment variables" below.
Create a new 2 variable and edit the 1 variables to fill in the following information, respectively:
New:
Variable name: java_home
Variable Value: Your JDK installation directory \jdk1.7.0
Variable name: CLASSPATH
Variable value:.; %java_home%\lib;%java_home%\lib\dt.jar;%java_home%\lib\tools.jar;%tomcat_home%\bin
(Note that there is a. Number at the front)
Edit:
Variable name: Path
Variable value:%java_home%\bin;%java_home%\jre\bin;
(Paste the red string here to the front of the variable value)
Start to run input cmd and enter Java separately in the command line; Javac Java-version
Such as: Display the following information, indicating that your Java environment variable configuration is successful
3. Download Tomcat, the official web download files are green-free installation. such as: Apache-tomcat-7.0.26-windows-x64.zip
: http://tomcat.apache.org/download-70.cgi
Unzip after download: E:\apache-tomcat-7.0.26, wherever you like to unzip.
4. Set the TOMCAT environment variable
New:
Variable name: tomcat_home
Variable value: The directory where your Tomcat resides
such as: E:\apache-tomcat-7.0.26
Now the environment is basically built, you can try it.
Start Tomcat, run the Tomcat directory/bin/startup, (click on startup, like a flash, or pop up a command-line window, not very cool, the article will refer to how to deal with)
Then in the browser, enter http://localhost:8080
If the page is displayed, congratulations on your successful environment!
We have seen a tomcat7w.exe in the Tomcat Directory/bin folder, as the name implies, Tomcat displays the console in window mode. 1th Click to open it, you may be prompted: the service specified by Tomcat is not installed, and we can resolve it this way.
Open the command Line Prompt window and enter the Tomcat installation directory ==> into the bin directory ==> input: Service.bat Install, operation, Tomcat directory on your own machine to come OH
This lets tomcat display the console in window mode. Click Tomcat7w.exe to display
Click Start to start the Tomcat service, if startup type chooses automatic, it will start up with the boot, so it does not need to be manually opened every time.
5: Common tomcat configuration settings tips
First, port 8080 is changed to 80, so Http://localhost:8080/web project can be directly written as: Http://localhos/web project
Tomcat Directory/conf/folder: Edit the Server.xml document,
Will: <connector port= "8080" protocol= "http/1.1" connectiontimeout= "20000" redirectport= "8443"/>
Instead: <connector port= "protocol=" http/1.1 "connectiontimeout=" 20000 "redirectport=" 8443 "/>
Second, configure the virtual directory for the Web project
Before configuring, you must create a new folder in your WEB project folder: Web-inf, this folder must have a file with Web. Xml. These can be copied directly in the tomcat/webapps/root/, put in your own Web project.
If you do not configure, you will need to put the Web project's folder under Tomcat/webapps/, Access path is: Http://localhost:8080/web project folder name
If the Web project is placed in a different drive letter, under the Tomcat Directory/conf/folder: Edit the Server.xml document,
At the end of the document, add: <context path= "/nala" docbase= "E:\www\nala" ></CONTEXT>
Where path is the access identifier, Docbase is the directory where the actual project is located, so after the designation, reboot Tomcat, access: Http://localhost:8080/nala, it is also successful.
OK, all the configuration and instructions are complete, you can use the Tomcat environment under the Win7 cool!
Win7 installation configuration Tomcat,java the operating environment