Build an eclipse + myeclipse + Tomcat Development Environment

Source: Internet
Author: User
Purpose:This article is used to help beginners quickly build the development environment of eclipse + myeclipse + Tomcat. You can develop various Java applications using the established environment, such as servelet and JSP.

Installation steps: 1. Install JDKFirst download JDK 5.0 (JDK 5.0 download page: http://java.sun.com/j2se/1.5.0/download.jsp); then run JDK 5.0installer jdk-rj5_0_06-windows-i586-p.exe, all options remain default during installation; finally configure JDK environment variables: right-click "my computer" and choose "properties"> "advanced"> "environment variable (n )".

Create a system variable java_home: C:/program files/Java/jdk1.5.0 _ 06;
New system variable classpath:.; % java_home %/LIB; (Note: The dot number indicates the current directory and cannot be omitted)
In the PATH value of the system variableFrontAdd the following content: % java_home %/bin; (Note: The semicolon here cannot be omitted)
Here, JDK installation is complete.
Next we will test whether JDK is successfully installed:
Copy the following content to notepad:
Public class hellojava {
Public static void main (string SRG []) {
System. Out. println ("Hello Java! ");
}
}
Save it as "hellojava. Java" (without quotation marks, the same below) and save it to the root directory of drive D. Enter the command marked by the red line in the command line in sequence: If the content marked in the red box appears, the JDK is successfully installed!
Note: If you want to install integrated development environments such as Eclipse, Borland JBuilder, jcreator, and intellij idea (IDE, integrated development environment) in the future, compile and run a simple helloworld program in the IDE, to ensure that the IDE can identify the JDK location.Ii. install TomcatThe download page of the secret is:
Http://apache.linuxforum.net/tomcat/tomcat-5/v5.0.30/bin );
Then, unzip jakarta-tomcat-5.0.30.zip to the root directory of drive D. Finally, configure the Tomcat environment variable: right-click "my computer" and choose "properties"> "advanced"> "environment variable (n )".
New system variable catalina_home: D:/jakarta-tomcat-5.0.30
In the system variable classpath ValueBackAdd: % catalina_home %/common/LIB;
In the PATH value of the system variable "% java_home %/bin ;",BackAdd the following content: % catalina_home %/bin;
At this point, tomcat installation is complete.
After completing step 1 and step 2, the values of the system variables are as follows:
Java_home: C:/program files/Java/jdk1.5.0 _ 06
Catalina_home: D:/jakarta-tomcat-5.0.30
Classpath:.; % java_home %/LIB; % catalina_home %/common/LIB;
Path: % java_home %/bin; % catalina_home %/bin; % SystemRoot %/system32; % SystemRoot %/system32/WBEM3. Install eclipseFirst download eclipse-sdk-3.1.2-win32.zip(eclipse-sdk-3.1.2-win32.zip:
Http://www.eclipse.org/downloads );
Then, extract eclipse-sdk-3.1.2-win32.zip to the root directory of drive D: Here, eclipse is installed.4. Install myeclipseThe first download of the unzip iseworkbenchinstaller_4.1.1ga_e3.1.exe(iseworkbenchinstaller_4.1.1ga_e3.1.exe is:
Http://www.myeclipseide.com/ContentExpress-display-ceid-10.html );
Then install enterpriseworkbenchinstaller_4.1.1ga_e3.1.exe. Note: select the eclipse installation path () when installing to the steps shown. Keep the default values for other options. After installation, overwrite the features and plugins directories under the myeclipse installation directory to the eclipse installation directory.
Finally, uninstall the installed myeclipse.
To explain the reason for this: Because myeclipse is the Eclipse plug-in, eclipse will automatically recognize these plug-ins as long as the features and plugins directories are overwritten to the eclipse installation directory.
Here, myeclipse is installed.5. Crack myeclipseRun myeclipse4.1.1registration machine myeclipsekeygen.exe, select the version number of myeclipse, enter the registration name, and generate the serial number. (The myeclipse4.x registration machine is:
Http://esoft.g8.com.cn/UploadFiles/2006-5/520753587.rar)
Run eclipse.exe (specify the workspace for the first time), click window ----> preferences ----> myeclipse ----> subscribe ----> enter subscribe, and enter the registration name and the registration code generated by the Registration machine.
Here, myeclipse has been cracked.Vi. Specify the JRE and tomcat servers of eclipse + myeclipse1. Set the JRE of eclipse + myeclipse
In general, eclipse can automatically find JRE, so we don't need to make too many settings.
2. Set the Tomcat server of eclipse + myeclipse
You only need to set the two parts marked in the graph. The rest of the graph is automatically generated. At this point, our eclipse + myeclipse development environment has been set up!7. Create a project to test whether the eclipse + myeclipse development environment has been successfully set up.(1)CreateWebProjectIn eclipse, click "file ----> New ----> Project ", in the displayed "new project" dialog box, click "Web project ----> myeclipse ----> J2EE projects ----> Web Project", and click "Next ", in "project name", enter the project name "test" and click "finish ".(2)CreateJSPFileClick "test" in the left package explorer list of eclipse to expand the project "test. Right-click webroot ----> New ----> JSP to create a JSP page named hello. jsp. Code example (we need to manually add the marked part in the figure, and the remaining part is automatically generated by the system ):(3)In the same way,CreateHello_result.jspOfJSPFile;The Code is as follows:(4) deploy(Deployment) project.
Click the deploy button (the red line is the deploy button). In the displayed window, click Add to deploy the test project ().(5)StartTomcatServer.As shown in (the button drawn with the red line is the button for starting Tomcat ):

Tomcat startup output information is as follows: 6.Project test running result: You can go to the eclipse workspace directory to check the code of the test project, or go to the webapps directory of Tomcat to check the structure of the tested project after deployment. 7. Check eclipse Is the setting correct;
After all the settings are configured, check whether the settings of eclipse> Windows> preferences> Tomcat are correct. Check whether the Tomcat base project is correctly set, as shown in: Note: additional project creation practicesAlthough JSP files can be created using the above method, this method cannot automatically contain some class libraries in Tomcat, which may cause a lot of trouble after the project is deployed, therefore, we recommend that you use the following methods to create a project: (1) In eclipse, perform operations as needed: Eclipse> File> New> Project>, in the displayed window, select Java> Tomcat project to create a new project. (2) after the project is created, right-click the project name in package Development E, in the shortcut menu that appears, choose myeclipse> Add webproject capabilities (as shown in). After adding this function, you can develop various web applications. (3) the method for deploying a project is the same as described above. After the project is released, the corresponding application directory is automatically generated in the tomcat/webapp/directory, which can be directly used by users;
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.