Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build a java compilation environment

2025-04-13 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces how to build a java compilation environment, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.

one. In the environment variable:

Classpath

C:SunAppServerjdklib ools.jar;C:SunAppServerjdklibdt.jar

CWR SunAppServerjdklibinterCWR SunAppServerjdklibantin

C:Program FilesMicrosoft SQL Server 2000 Driver for JDBClibmsbase.jar

C:SunAppServerjdklib ools.jar;C:SunAppServerjdklibdt.jar

C:SunAppServerjdkjrelibextjtds-0.7.1.jar

Java_home

C:SunAppServerjdk

PATH

CWR SunAppServerjdkinTrent DRV apacheMurantMet 1.6.1in

ANT_HOME

D:apache-ant-1.6.1

two. Eclipse installation of its language pack

Step 1: decompress. First turn off Eclipse, then extract the downloaded language package, and then give the folder a slightly more concise one.

Directory name (I call it: eclipse2.1.2.1Language). Then copy the whole directory to C:eclipse2.1.3eclipse to copy.

The entire Eclipse directory after that

Step 2: create the link file. Create a new folder links under C:eclipse2.1.3eclipse, and then create a new folder in the links directory

Text file, file name and extension (I call it language.link). Then add a line of text to the file:

Path=eclipse2.1.2.1Language

Note: the path separator consists of two backslashes.

three. Eclipse+Tomcat integrated development servlet

Prepare:

1. Tomcat4.0

2. Jdk1.4

3. Eclipse2.1.3

4. Download the Tomcat plug-in for Eclipse from http://www.sysdeo.com/eclipse/tomcatPluginV21.zip

Installation:

1. Install jdk1.4

2. Install Tomcat4.0

3. Install Eclipse2.0 and decompress it.

4. Extract the tomcatPluginV21.zip and copy the com.sysdeo.eclipse.tomcat folder in it to

In the plugins directory under the Eclipse installation directory.

Configuration:

1. Start Eclipse

2. Open the menu Windows- > Preferences

3. Select Tomcat on the left, and you can see some forms appear on the right.

4. Tomcat Version Select Version 4.1.xTomcat Home choose the installation path of Tomcat, Configuration

The configuration file server.xml of Tomcat will be automatically filled in File.

5. Expand the Tomcat menu on the left, select JVM Settings,JRE and select Detected VM

6. Press Apply

7. Press OK

8. See if there are a few kitten icons in your toolbar, and if not, select the menu

Windows-> Custmize Perspective, expand the other option and tick Tomcat. OK, see the kitten icon.

9. Try the Start Tomcat button. OK, Tomcat starts in console.

Example:

Let's take an example of Hello World.

1. Select File- > New- > Project

2. Select Tomcat Project in the dialog box, and then next

3. Enter Project Name, where you can write HelloWorld and continue next.

4. Check the can update server.xml file option, finish, OK, a Poject has been created.

5. Open the new class wizard and fill in HelloWorld in Name and Superclass

Javax.servlet.http.HttpServlet, press finish. OK, a servlet will be created.

6. Overload the doGet method in HelloWorld.java, 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!")

}

}

Save 8.Ctrl+S, right-click HelloWorld project, and select Tomcat Project- > update context to server.xml

7. Start Tomcat in Eclipse

9. Access http://localhost:8080/HelloWorld/servlet/HelloWorld in active browser

four. Download and install Lomboz

1. Extract the downloaded lomboz.213.zip file.

2. Copy the extracted files to a directory in Eclipse. This article is C:eclipse2.1.3eclipse.

Since there is no eclipse directory in the lomboz.213 directory when decompressing, you need to create it yourself, and then change the plugins directory in the lomboz

Copy it in. Directory structure in Explorer

3. Create a new text file in the C:eclipse2.1.3eclipselinks directory, which is called lomboz.213.link.

There is only one line: path=lomboz.213

4. Then start Ecipse. Select menu: file-> New-> Project, and then select the menu after creating a new project:

File-> New-> other.

Five: install mySql JDBC Driver and MS SQLServer JDBC Driver

The installation method is as follows: unlock the mysql-connector-jdbc-3.0.10-stable.zip and change the

Mysql-connector-java-3.0.10-stable-bin.jar under the mysql-connector-jdbc-3.0.10-stable directory

The files are copied into the c:jbossserverdefaultlib directory under the JBOSS installation directory C:JBOSS.

Perform SQLServer2KJDBCsetup.exe installation to C:Program FilesMicrosoft SQLServer 2000 Driver for

Under the JDBC directory and under the lib directory (that is, C:Program FilesMicrosoft SQL Server 2000 Driver for JDBClib)

The three files msbase.jar, mssqlserver.jar and msutil.jar in the directory are copied into the C:JBOSS in the JBOSS installation directory

Under c:jbossserverdefaultlib directory.

At the same time, finally start the MS SQL Server2k server and connect to it with a query analyzer, and execute:

Under the C:Program FilesMicrosoft SQLServer 2000 Driver for JDBCSQLServer JTA directory:

Instjdbc.sql script.

6. Configure the database connection pool of JBOSS so that it can connect to MySQL and SQL Server correctly. The methods are as follows:

Go to the JBOSS installation directory C:JBOSS and enter the C:JBOSSserverdefaultdeploy directory under it

Use notepad to create two new files, mssql-ds.xml and mysql-ds.xml, 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

MSSQLjdbc:microsoft:sqlserver://10.0.0.18:1433

DatabaseName=test

Com.microsoft.jdbc.sqlserver.SQLServerDriver

Sa

six. Install the running environment for mySql JDBC Driver.

Classpath

D:Program Files

Microsoft SQL Server 2000 Driver for JDBClibmsbase.jar

D:Program FilesMicrosoft SQL Server 2000 Driver for JDBC

Libmssqlserver.jar

D:Program FilesMicrosoft SQL Server 2000 Driver f or JDBC

Libmsutil.jar

Thank you for reading this article carefully. I hope the article "how to build a java compiler environment" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report