This is a necessary process for Java Web development. It is for reference only by novices and can be ignored by experts!
Let's take a look at what to install:
jdk download address: //www.VeVB.COM/softs/214120.html
eclipse download://www.VeVB.COM/softs/143046.html
MySQL download://www.VeVB.COM/softs/40589.html
tomcat download://www.VeVB.COM/softs/417569.html
You can also download it on the official website. The version may not necessarily be the same. If you can’t find it, google it and enter the topic below.
1. Install JDK
1. Download jdk-6u35-windows-i586.exe, about 70M, directly double-click to run the installation, and just next all the way. By default, it is installed to the Program Files under the system disk. I installed it here under C:/Java. Note that after installing jdk, it will automatically run and install jre. The installation path at this time is best to be the same as jdk, which is convenient for management. Mine is all under C:/Java.
2. Environment variable configuration: Right-click "My Computer" and click "Properties"; select the "Advanced" tab and click "Environment Variables"; In "System Variables", set 3 properties, JAVA_HOME, PATH, and CLASSPATH (case doesn't matter). If it already exists, click "Edit", and if it does not exist, click "New"; generally PATH already exists.
3. The configuration is as follows:
JAVA_HOME
C:/Java/jdk1.6.0_35
CLASSPATH
.;%JAVA_HOME%/lib/dt.jar;%JAVA_HOME%/lib/tools.jar;
Path
%JAVA_HOME%/bin;%JAVA_HOME%/jre/bin;
As shown in the picture:
Note: There is a point in front of the variable value of the CLASSPATH term. The variable value of Path is generally added to the front of the original value. If added to the back, it should be separated by a semicolon.
4. Verify whether the installation is successful: "Start" ->; "Run", type "cmd"; type the command "java -version", "java", and "javac", and the screen appears, indicating that the environment variable configuration is successful;
2. Install tomcat
1. Download apache-tomcat-6.0.35.exe, about 7M. I installed the package (it is just to decompress the compressed package directly). Double-click to run next to complete the installation. You can also configure the installation path. I keep the default path and the port is also default 8080.
2. Verify the installation: Open the browser, type http://localhost:8080/, and if the page appears, the installation will be successful:
3. Eclipse installation and configuration
1. Download eclipse-jee-juno-win32.zip, about 220M, directly decompress, I decompress to C:/eclipse;
2. Download the Tomcat plugin tomcatPluginV33.zip (must download the corresponding version of eclipse), which is about 330K, and you can decompress and get the com.sysdeo.eclipse.tomcat_3.3.0 folder;
3. Copy the com.sysdeo.eclipse.tomcat_3.3.0 folder to the plugins plugin folder in the eclipse directory. Here is C:/eclipse/plugins, as shown in the figure below:
4. Run eclipse and set workspace. I set it in C:/workspace. After running eclipse, the Tomcat toolbar will appear on the toolbar. If not, check the previous steps, as shown in the figure:
5. Then perform eclipse configuration, first with jre. Generally, this item has been configured, as shown in the figure below:
6. Then there is the web application server configuration, the steps are as follows:
Click Add. . .
Select Tomcat v6.0 and then Next. . .
Select the installation path of Tomcat and the corresponding jre, and finish.
7. Configure Tomcat, select the version, installation path, and Server.xml, as shown in the figure below:
Set the Tomcat path under Advanced, as shown in the figure below:
JVM settings. . .
After completing the above steps, Tomcat has been configured.
4. MySQL installation and configuration
1. Download mysql-5.5.27-win32.msi, about 30M, run the installation directly, and just go Next. You need to pay attention to the network port generally keep the default 3306, and the character encoding is generally set to UTF-8. Remember the root user password you set. If there is no accident, it can be installed successfully;
2. Download navicat lite mysql.rar, about 8M, this is a graphical interface tool used to manage MySQL, just install it directly;
3. Run navicat lite and create a new database connection, as shown in the figure below:
Fill in the connection name (fill it casually), as well as the root username and password, as shown in the figure below:
If the test connection is successful, you can find the connection in the left column. Double-click it to open the corresponding database server.
4. Next is to create a new database, as shown in the figure below:
5. To create a new table, you can use the interface to create it, or you can use SQL statements, as shown in the figure below:
6. Double-click the corresponding table to open the table for data addition, modification and deletion, as shown in the figure below:
Summary: At this point, the Java Web development environment has been basically built. If it runs in time, I will write an example program in the next article to share it with you!