[ZT] Construction of Java Compilation Environment

xiaoxiao2021-03-06  18

First, in environment variables:

Classpath

C: /sun/appserver/jdk/lib/tools.jar; c: /sun/appserver/jdk/lib/dt.jar;

C: / sun / appserver / jdk / lib / bin; c: / sun / appserver / jdk / lib / ant / bin

C: / Program Files / Microsoft SQL Server 2000 Driver for JDBC / LIB / MSBASE.JAR;

C: /sun/appserver/jdk/lib/tools.jar; c: /sun/appserver/jdk/lib/dt.jar;

C: /sun/appserver/jdk/jre/lib/ext/jtds-0.7.1.jar;

Java_home

C: / sun / appserver / jdk

Path

C: / sun / appserver / jdk / bin; d: /apache-ant-1.6.1/bin;

Ant_home

D: /Apache-ant-1.6.1

Second, Eclipse Its Language Pack Installation First: Unzip. First turn off the Eclipse, then extract the downloaded language compressed package, then give this folder to a slightly concise directory name (I named: eclipse2.1.2.1language). Then copy the entire directory to c: /eclipse2.1.3/eclipse Next: Establish a link file. Create a folder Links in C: /Eclipse2.1.3/eclipse, then create a new text file, filename and extension in the links directory (I am named language.link). Then add a line in the file: path = Eclipse2.1.2.1Lnguage Note: The path separator consists of two backslash. Third, Eclipse Tomcat integration development servlet preparation: 1. Tomcat4.0 2. JDK1.4 3. Eclipse2.1.3 4. Eclipse's Tomcat plugin is downloaded in http://www.sysdeo.com/eclipse/tomcatpluginv21.zip: 1. Install JDK1.4 2. Install Tomcat 4.0 3. Install Eclipse 2.0 and decompress 4. Decompress TomcatPluginv21.zip and copy the com.sysdeo.eclipse.tomcat folder to the plugins directory in the Eclipse installation directory. Configuration: 1. Start Eclipse 2. Open Menu Windows-> Preferences 3. Select Tomcat on the left, you can see some forms 4 appear on the right. Tomcat Version Selects Version 4.1.x, Tomcat Home Select Tomcat's installation path. The configuration file is automatically filled in the Tomcat configuration file server.xml 5. Expand the Tomcat menu on the left, select JVM Settings, JRE Select Detected VM, 6. Press APPLY 7. Press OK 8. Look at your toolbar, don't have a few kittens icons. If you don't, select Menu Windows -> CustMize Perspective, expand the Other option, tick on Tomcat, ok, see the kitten icon. 9. Try the Start Tomcat button, ok, Tomcat launched in Console. Example: Do an example 1 of Hello World below. Select File-> New-> Project 2. Select Tomcat Project in the dialog, then Next 3. Enter Project Name, here you can write HelloWorld, continue next 4. Hook the Can Update Server.xml File option, finish, ok, a POJECT has been created.

5. Open the New Class Wizard, fill in HelloWorld in Name, fill in javax.servlet.http.httpservlet.http.httpservlet in SuperClass, press Finish, ok, a servlet is created 6. Remove the Doget method in HelloWorld.java, the code is as follows: import javax.servlet.http.httpservlet;

Import javax.servlet.http.httpservlet;

Import javax.servlet.http.httpservletRequest;

Import javax.servlet.http.httpservletResponse;

Import java.io.ioException;

Import java.io.printwriter;

Import javax.servlet.servletException;

Public class helloworld extends httpservlet {

Public void doget (httpservletRequest request, httpservletResponse response)

THROWS IOException, servletexception {

Response.setContentType (Text / HTML ");

PrintWriter Writer = response.getwriter ();

Writer.println ("Hello World!");

}

}

8.ctrl s Save, Right button HelloWorld Project, select Tomcat Project-> Update Context to Server.xml 7. Start Tomcat 9 in Eclipse 9. Access http: // localhost: 8080 / helloworld / servlet / helloWorld , Lomboz download and installation 1, extract the downloaded Lomboz.213.zip file. 2. Copy the decompressed file to the Eclipse a directory. This article is C: / ECLIPSE2.1.3/Eclipse. Due to the decompression, there is no Eclipse directory in the Lomboz.213 directory, you need to build it yourself, then copy the Plugins directory in Lomboz into it. The directory structure in the Explorer. 3, create a new text file in the c: /eclipse2.1.3/eclipse/links directory, now named: lomboz.213.link, only one line: Path = Lomboz.213 4, then start ECIPSE. Select Menu: File -> New-> Project, select menu after new project: File -> New ->. 5. Installing MySQL JDBC Driver and MS SQLServer JDBC Driver Installation Method: Unlocked mysql-connector-jdbc-3.0.10-stable.zip, mysql-connector-jdbc-3.0.10-stable directory of MySQL -connector-java-3.0.10-stable-bin.jar file is copied into the JBoss installation directory C: / jboss / server / default / lib directory under the C: / LIB directory. Execute SQLServer2kjdbcSetup.exe installation to the C: / Program Files / Microsoft SQL Server 2000 Driver for JDBC directory, and put it under the lib directory (ie, C: / Program Files / Microsoft SQL Server 2000 Driver for JDBC / LIB) MSBase .jar, mssqlserver.jar and msutil.jar three files are copied into the JBoss installation directory C: / jboss / server / default / lib directory under the C: / Lib Directory under the C: / jboss. At the same time, the MS SQL Server2k server is started and connected to the above, execute: C: / Program Files / Microsoft SQL Server 2000 Driver for JDBC / SQL Server JTA directory: instjdbc.sql script. 6. Configure the JBoss database connection pool so that it can be connected to Mysql and SQL Server. The method is as follows: Enter the JBoss installation directory C: / jboss, enter the bottom C: / JBoss / Server / Default / Deploy directory, use Notepad to create two files MSSQL-DS.XML and MYSQL-DS.XML, content As follows: 1, mysql-ds.xml

mysql jdbc: mysql: //10.0.0.18: 3306 / test

Org.gjt.mm.mysql.driver

root

2, MSSQL-DS.XML

MSSQL JDBC: Microsoft: SQLServer: //10.0.0.18: 1433;

DatabaseName = Test

com.microsoft.jdbc.sqlserver.sqlserverdriver

SA

6. Install the operating environment of mysql JDBC Driver

Classpath

D: / program files /

Microsoft SQL Server 2000 Driver for JDBC / LIB / MSBASE.JAR;

D: / Program Files / Microsoft SQL Server 2000 Driver for JDBC /

LIB / MSSQLSERVER. JAR;

D: / Program Files / Microsoft SQL Server 2000 Driver F or JDBC /

LIB / MSUTIL.jar

转载请注明原文地址:https://www.9cbs.com/read-46098.html

New Post(0)