Build a J2EE development environment (3) -- save the J2EE development environment you have set up

Source: Internet
Author: User

after JDK, tomcat, and eclipse are installed, and tomcat-plugin and lomboz-plugin required for JSP development are installed, the J2EE development environment has been set up. However, in case of computer poisoning, the system needs to be reinstalled once and for all, this complicated process has to be re-launched. Therefore, it is best to install these systems in the same root directory from the very beginning, for example, E: \ J2EE. My J2EE development environment is installed in this directory, which contains eclipse, eclipse-plugins, JDK, and tomcat, eclipse IDE, lomboz, and tomcat plug-ins, jdk jvm, and tomcat servers are installed in these four directories respectively. In this way, even if the system reinstalls, as long as the E disk is not formatted, after the system reinstalls, you only need to add the five environment variables java_home, classpath, catalina_base, catalina_home, and tomcat_home in "My Computer", "properties", "advanced", and "system variables, at the same time, after modifying the PATH environment variable in the Windows system, the J2EE development environment is completely restored. Enter Java-version in the doc window. If it can be executed, JDK can be used. If it is in the \ J2EE \ Tomcat \ conf \ Catalina \ localhost \ directory. delete the XML file and enter http: // localhost: 8080/in the browser. If the Apache Tomcat homepage can be opened, the Tomcat server can also be used; open \ J2EE \ eclipse \ eclipse.exe. If Eclipse IDE can be started, the Java Development Environment eclipse can also be used. After opening eclipse, click "file" -- "import ", in the displayed dialog box, select "existing projects into workspace", select a previously developed J2EE project from the local computer, and open one after the import. java file and. JSP files. If no problem exists, it means that eclipse and JDK are still associated, and the lomboz plug-in can also work normally. Finally, create a file in the \ J2EE \ Tomcat \ conf \ Catalina \ localhost \ directory. XML file. The file name is the same as the name of the imported project (that is, the context root and context root directory of the project). The project name is gift. Enter the following content in the file:

<? XML version = "1.0" encoding = "UTF-8"?>
<Context Path = "/gift" reloadable = "true" docbase = "D: \ projects \ 0906 \ 000-Code\ Webcontent "workdir =" D: \ projects \ 0906 \ 000-Code \ work "crosscontext =" true "DEBUG =" 0 "/>

Restart the Tomcat server to run \ J2EE \ Tomcat \ bin \ Startup. bat, enter http: // localhost: 8080/gift in the browser, and press Enter. If you can enter the project, Tomcat works normally. Of course, if you need to connect to the MySQL database on the project homepage, you also need to recreate the database.

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.