Sometimes we need to add a third-party jar package in a Java project. In this case, you should add the best relative path,
Instead of absolute path. Otherwise, your project won't run unless you get it. That is to say, you 'd better put the relevant jar in the project directory. The web project is relatively simple. The web project has a lib directory. Just copy it here. Not web engineering. Eclispe cannot import copy automatically.
This requires manual configuration. For the work description file, eclipse and myeclpse are described in XML.
Now let's take a look at the eclipse. classpath file:
<? XML version = "1.0" encoding = "UTF-8"?>
<Classpath>
<! -- Source code directory -->
<Classpathentry kind = "src" Path = "src"/>
<! -- JDK runtime container -->
<Classpathentry kind = "con" Path = "org. Eclipse. jdt. Launching. jre_container"/>
<! -- The following is the directory customized by the class library path. -->
<Classpathentry kind = "lib" Path = "lib/swing-layout-1.0.3.jar"/>
<Classpathentry kind = "lib" Path = "lib/absolutelayout. Jar"/>
<Classpathentry kind = "lib" Path = "lib/jtds-1.2.2.jar"/>
<Classpathentry kind = "lib" Path = "lib/jxl. Jar"/>
<! -- Output the class directory after compilation -->
<Classpathentry kind = "output" Path = "bin"/>
</Classpath>
I have added comments to XML. You also understand.
. Project File: <? XML version = "1.0" encoding = "UTF-8"?>
<Projectdescription>
<! -- Project name -->
<Name> execlinterface </Name>
<Comment> </comment>
<Projects> </Projects>
<! -- The compiler specifies -->
<Buildspec>
<Buildcommand>
<Name> org. Eclipse. jdt. Core. javabuilder </Name>
<Arguments> </arguments>
</Buildcommand>
</Buildspec>
<! -- Core features -->
<Natures>
<Nature> org. Eclipse. jdt. Core. javanature </nature>
</Natures>
</Projectdescription>
A. mymetadata file is added to the myeclipse project: <? XML version = "1.0" encoding = "UTF-8"?>
<! --
Type: project type
Name: Project name
ID: Unique identifier of a project in a workspace
Context-root: website root path
J2ee-spec: J2EE standard
Archive: War file after Packaging
-->
<Project-Module
Type = "Web"
Name = "Upload"
Id = "myeclipse.1152954865843"
Context-root = "/upload"
J2ee-spec = "1.4"
Archive = "Upload. War">
<Attributes>
<! -- Value: web root directory name -->
<Attribute name = "webrootdir" value = "webroot"/>
</Attributes>
</Project-module>