Tomcat7.0 configuration to solve the problem of flashing back after you click startup. bat

Source: Internet
Author: User

I recently started to learn JSP programming. Of course, before we start programming, we should first prepare the development tools for JSP development. Our preferred tool is Myeclipse. Of course, this is paid, but everyone understands that, of course, we can use eclipse for development. The principle is the same. Now I will summarize the configuration process of using tomcat in Myeclipse as follows, of course, I am curious, I also gave tomcat to my favorite eclipse3.7 configuration, which is just the same!

Myeclipse Configuration:
First download tomcat: http://apache.org/
I use a version free of installation. After downloading it, decompress it and start configuration (JSP is developed based on JAVA language, so jdk is required)

1. Configure JDK

To install Tomcat on your computer, JDK support is required, because Tomcat is a lightweight Web Server written in java.

1. First download the downloaded jdk (1.7 here), decompress or install it. It is best to install jdk and jre in the same java directory, such as d: \ Program Files \ java \ jdk1.7.

2. Configure System Variables

(1) Right-click "my computer", select "properties"-"advanced", and click "environment variables ".

(2) In order to easily change the jdk path and some other software in the future, it is best to create a JAVA_HOME environment variable with the property value "d: \ Program Files \ java \ jdk1.7 ", add "% JAVA_HOME % \ bin" to the path environment variable, preferably in front.

(3) Click "new" in the "user variables" box, enter "classpath" in the "variable name" field, and enter "." in the "variable value" field. % JAVA_HOME % \ lib \ tools. jar; % JAVA_HOME % \ lib \ rt. jar ". After the configuration is complete, enter java-version in the Command window to view the current version. If a prompt is displayed, the operation is successful.

2. Configure Tomcat

1. Download The tomcat.zip package. I am using the latest 7.0.27 and decompress it to the d: \ Program Files \ tomcat7 directory. Tomcat is: http://tomcat.apache.org/download-70.cgi, select 32-bit Windows zip or 64-bit Windows zip option on the download page.

2. environment variable settings:

First, add the TOMCAT_HOME environment variable with the value d: \ Program Files \ tomcat7. Add the CATALINA_HOME environment variable with the value % TOMCAT_HOME %. Add the CATALINA_BASE environment variable with the value % TOMCAT_HOME %. The installation-free version requires these two environment variables, which are written as "%" to facilitate later version changes. You can directly modify the TOMCAT_HOME value, change the values of CATALINA_HOME and CATALINA_BASE.

For a version without installation, the most important thing is to modify the startup. bat file in the conf folder under the root directory. If you do not modify the file, you may not be able to start Tomcat,

Add the following two lines before the first line (or after echo off:

SET JAVA_HOME = JDK directory

SET CATALINA_HOME = the Tomcat directory after decompression.

If you need to use shutdown. bat to shut down the server, add two lines as shown above.

3. In this way, run startup. bat to run the server, and run shutdown. bat to close the server.

Iii. tomcat and Myeclipse Association

Install Myeclipse and open the menu bar Window --> Preferences --> MyEclipse --> Severs --> tomcat

Then select tomcat 7. XXX configuration,

Then you can write a web program in Myeclipse and publish it to the tomcat service!

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.