Building a Java Web development environment under Windows

Source: Internet
Author: User
Tags mysql gui mysql gui tools

Profile
1. SSH development related software and development package download
2. Software Installation and related settings
3. The simplest web program

1. Software download
Build a directory Javatools in D to store downloaded software and development packages. (This tutorial will use the D drive, you can also use the C or E drive). Download the principle of software, there is a zip version of the EXE version.
1) JDK:JDK 6 Update 7 Windows edition
Download page: http://java.sun.com/javase/downloads/index.jsp
Download Link:
https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/ Viewfilteredproducts-singlevariationtypefilter;pgid=yydgahqkkjvsr0eupiqsoq3d0000o_tqgogy;sid= aeftgeasikttgq4qzlglhakfzl2ycyvpvauiqvuyc5igaw==
More information: http://java.sun.com
2) Ide:eclipse IDE for Java EE developers
Download page:
http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/ganymede/R/ Eclipse-jee-ganymede-win32.zip
Download Link:
http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/ganymede/R/ eclipse-jee-ganymede-win32.zip&url=http://download.actuatechina.com/eclipse/technology/epp/downloads/ release/ganymede/r/eclipse-jee-ganymede-win32.zip&mirror_id=385
More information: http://www.eclipse.org/
3) Web Server:tomcat 6.0.16
Download page:
http://tomcat.apache.org/download-60.cgi
Download Link:
Http://www.meisei-u.ac.jp/mirror/apache/dist/tomcat/tomcat-6/v6.0.16/bin/apache-tomcat-6.0.16.zip
More information:
http://tomcat.apache.org/
4) database:mysql-5.0 without installer
Download page:
Http://dev.mysql.com/downloads/mysql/5.0.html#win32
Download Link:
Http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-noinstall-5.0.51b-win32.zip/from/pick#mirrors
More information:
http://dev.mysql.com/
5) Database GUI client
Download page:
Http://dev.mysql.com/downloads/gui-tools/5.0.html
Download Link:
Http://dev.mysql.com/get/Downloads/MySQLGUITools/mysql-gui-tools-noinstall-5.0-r12-win32.zip/from/pick#mirrors
6) Eclipse Plugin
6.1) Sysdeo Eclipse Tomcat Launcher Plugin
Download Link:
Http://www.eclipsetotale.com/tomcatPlugin/tomcatPluginV321.zip
More information:
Http://www.eclipsetotale.com/tomcatPlugin.html
7) Development Package
7.1) Struts 2.1.2
Download Link:
Http://www.meisei-u.ac.jp/mirror/apache/dist/struts/binaries/struts-2.1.2-all.zip
Download page:
http://struts.apache.org/download.cgi#struts212
More information:
http://struts.apache.org/
7.2) Spring Framework 2.5.5
Download Link:
Http://downloads.sourceforge.net/springframework/spring-framework-2.5.5-with-dependencies.zip?modtime= 1214221252&big_mirror=0
Download page:
Http://www.springframework.org/download
More information:
http://www.springframework.org/
7.3) Hibernate
Download page: http://www.hibernate.org/6.html
Hibernate Core 3.2.6 GA
Download Link:
http://sourceforge.net/project/showfiles.php?group_id=40712&package_id=127784&release_id=574498
Hibernate Annotations 3.3.1 GA
Download Link:
http://sourceforge.net/project/showfiles.php?group_id=40712&package_id=139933
Hibernate Tools3.2.2 Beta
Download Link:
Http://sourceforge.net/project/downloading.php?groupname=jboss&filename=HibernateTools-3.2.2.Beta1.zip &use_mirror=osdn
Hibernate Validator 3.0.0 GA
Download Link:
http://sourceforge.net/project/showfiles.php?group_id=40712&package_id=225206
7.4) Freemarker 2.3.13
Download Link:
Http://prdownloads.sourceforge.net/freemarker/freemarker-2.3.13.tar.gz
More information:
http://www.freemarker.org/
The contents of the downloaded Javatools are as follows:
D:\JavaTools\apache-tomcat-6.0.16.zip
D:\JavaTools\eclipse-jee-ganymede-win32.zip
D:\JavaTools\freemarker-2.3.13.tar.gz
D:\JavaTools\hibernate-3.2.6.ga.zip
D:\JavaTools\hibernate-annotations-3.3.1.GA.zip
D:\JavaTools\HibernateTools-3.2.2.Beta1.zip
D:\JavaTools\hibernate-validator-3.0.0.GA.zip
D:\JavaTools\jdk-6u7-windows-i586-p.exe
D:\JavaTools\mysql-gui-tools-noinstall-5.0-r12-win32.zip
D:\JavaTools\mysql-noinstall-5.0.51b-win32.zip
D:\JavaTools\spring-framework-2.5.5-with-dependencies.zip
D:\JavaTools\struts-2.1.2-all.zip
D:\JavaTools\tomcatPluginV321.zip
(Note: Other software and development kits are used in development and then downloaded, such as jquery)
2. Installation settings
1) Installing the JDK
Double-click Jdk-6u7-windows-i586-p.exe to install JDK
Do not install public JRE and javadb, install to D:\, shown.

After the installation is complete, add java_home to the system variable of the window environment variable with a value of D:\jdk1.6.0_07, preceded by the PATH environment variable, with%java_home%\bin; (semicolons do not drop).
2) Install Eclipse
Unzip the D:\JavaTools\eclipse-jee-ganymede-win32.zip to D:\eclipse and rename it to D:\eclipse3.4.0.
Right-click D:\eclipse3.4.0\eclipse.exe, send a shortcut to the desktop, and rename the shortcut to Eclipse3.4.0.exe.
Extract d: \javatools\tomcatpluginv321.zip to D:\JavaTools\tomcatPluginV321\, and the com.sysdeo.eclipse.tomcat_ inside The 3.2.1 directory and contents are copied to the D:\eclipse3.4.0\dropins directory.
Start eclipse, and note that the workspace is set to the eclipse3.4.0 directory and set to default. See.



If normal, go inside and you'll see it on the tool bar.

Exit Eclipse.
3) Install Tomcat
Unzip the D:\JavaTools\apache-tomcat-6.0.16.zip to D:\apache-tomcat-6.0.16 and rename it to D:\tomcat-6.0.16.
Execute D:\tomcat-6.0.16\bin\startup.bat to start Tomcat.
View http://localhost:8080/in the browser
In normal words, you can see the Tomcat page.
Close the browser window and close the Tomcat console window.
4) Install MySQL
Unzip the D:\JavaTools\mysql-noinstall-5.0.51b-win32.zip to D:\mysql-5.0.51b-win32 and change the name to
D:\mysql-5.0.51b.
Execute D:\mysql-5.0.51b\bin\mysqld-nt.exe to start MySQL.
Unzip the D:\JavaTools\mysql-gui-tools-noinstall-5.0-r12-win32.zip to D:\MySQL GUI tools 5.0\.
Execute D:\MySQL GUI Tools 5.0\mysqlquerybrowser.exe to start the client.
Normally when OK goes in, you can access the database.
(Note: For easy access, you can create a shortcut to the above executable file)
3.Hello Java Web
1) Build Web Engineering
Set up the catalogue D:\Project used to put the project.
Start Eclipse.
Menu Window-->preferences-->tomcat.
The selection of Tomcat Version,tomcat Home and Context declaration mode is as shown.

OK to save.
Menu File-->new-->project...-->java-->tomcat Project, Next, project name fills Bitrac.
Use the default location to cancel, and then select D:\Project as shown

Add \bitrac to the back of the location.
Next, set Webroot, see

Finish to complete the project creation.
Normal will go to the Java view, where you can see the engineering structure shown in Eclipse.

Right-click Webroot/web-inf/src,delete in eclipse to delete this directory.
Right-click on Bitrac, select Tomcat project-->update context Definition on the shortcut menu, and after success, you will see D:\tomcat-6.0.16\conf\Catalina\ There is a bitrac.xml file under localhost.
Right-click on the Bitrac, select Properties-->tomcat-->context Name from the shortcut menu, change the Bitrac to Bitrac, and repeat the steps above to update the CONTEXT definition.
On Bitrac, right click on the shortcut menu, select Properties-->resource-->text file Encoding-->other, and select Utf-8,ok save. (The above operation actually opens the Project Properties dialog box, which will be replaced later)
2) New File
Select Webroot, shortcut key CTRL + N opens the new File dialog box, web-->jsp, Next, file name fill index.jsp,finish complete the new file.
Write a Hello Java Web between the <body></body> of the new file.
3) Run
Click the first button in the Tomcat plugin button on the toolbar to start Tomcat.
View http://localhost:8080/bitrac/in the browser
Normal will see Hello Java web, the simplest Java Web application completed.
4) Preparing for a complex Java Web application
Click the second button on the Tomcat plugin toolbar to stop Tomcat.
4.1) Unzip the D:\JavaTools\struts-2.1.2-all.zip to the D:\JavaTools\struts-2.1.2
The following files
D:\JavaTools\struts-2.1.2\lib\struts2-core-2.1.2.jar
D:\JavaTools\struts-2.1.2\lib\xwork-2.1.1.jar
D:\JavaTools\struts-2.1.2\lib\commons-fileupload-1.2.1.jar
D:\JavaTools\struts-2.1.2\lib\commons-io-1.3.2.jar
D:\JavaTools\struts-2.1.2\lib\commons-logging-api-1.1.jar
D:\JavaTools\struts-2.1.2\lib\ognl-2.6.11.jar
Copy to D:\Project\Bitrac\WebRoot\WEB-INF\lib
4.2) Unzip the D:\JavaTools\freemarker-2.3.13.tar.gz to the D:\JavaTools\freemarker-2.3.13
Copy the D:\JavaTools\freemarker-2.3.13\lib\freemarker.jar to
D:\Project\Bitrac\WebRoot\WEB-INF\lib, renamed as Freemarker-2.3.13.jar
4.3) unzip the D:\JavaTools\spring-framework-2.5.5-with-dependencies.zip to
D:\JavaTools\spring-framework-2.5.5
Copy the D:\JavaTools\spring-framework-2.5.5\dist\spring.jar to
D:\Project\Bitrac\WebRoot\WEB-INF\lib, renamed as Spring-2.5.5.jar
4.4) Unzip the D:\JavaTools\hibernate-3.2.6.ga.zip to the D:\JavaTools\hibernate-3.2\
Copy the D:\JavaTools\hibernate-3.2\hibernate3.jar to
D:\Project\Bitrac\WebRoot\WEB-INF\lib, renamed as Hibernate-3.2.6.jar
4.5) Unzip the D:\JavaTools\hibernate-annotations-3.3.1.GA.zip to
D:\JavaTools\hibernate-annotations-3.3.1.GA\
Copy the D:\JavaTools\hibernate-annotations-3.3.1.GA\hibernate-annotations.jar to
D:\Project\Bitrac\WebRoot\WEB-INF\lib, renamed as Hibernate-annotations-3.3.1.jar
4.6) Unzip the D:\JavaTools\hibernate-validator-3.0.0.GA.zip to
D:\JavaTools\hibernate-validator-3.0.0.GA
Copy the D:\JavaTools\hibernate-validator-3.0.0.GA\hibernate-validator.jar to
D:\Project\Bitrac\WebRoot\WEB-INF\lib, renamed as Hibernate-validator-3.0.0.jar
Open the Bitrac Project Properties dialog box
Java Build path-->libraries-->add Jars., add the jar under Lib to the current Libraries.
Extract the Web. Xml from D:\JavaTools\struts-2.1.2\apps\struts2-blank-2.1.2.war to D:\Project\Bitrac\WebRoot\ with WinRAR Under the Web-inf.
Open D:\Project\Bitrac\WebRoot\WEB-INF\web.xml
Change index.html to index.jsp, save.
Start Tomcat.

Building a Java Web development environment under Windows

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.