The workbench provides loose class path web libraries support
for your web projects.
About this task
Loose class path support is an optional mechanism that allows
for the inclusion of Eclipse Java™ development
tools class path artifacts in a web project's WEB-INF/lib folder.
You can add dependences using the Deployment Assembly page,
but you can also add the web libraries from the Libraries page
under the Java Build Page. You
can include JAR files, external JAR files, libraries, and variables.
The project validator detects loose class path issues and reports
them in the problems view.
Procedure
-
Right-click your web project and select .
-
Select Add Jars, and select the
JAR files that you want to add to your web project. Click OK.
-
Because these JAR files are added only to the build path
and are linked as components, if you deploy this EAR/WAR or export
this EAR/WAR none of these JAR files are included. A warning message
appears in the Problems view:
Classpath entry /AddJars/AddJars1.jar
will not be exported or published. Runtime ClassNotFoundExceptions
may result.
-
Right-click the warning message and select Quick
Fix. You can either:
- Mark the associated raw class path entry as a publish/export dependency.
- Exclude the associated raw class path entry from the set of potential
publish/export dependencies.
-
If you look at the .classpath file, the JAR files are now
either included or excluded from the dependencies:
-
Right-click the web project, and select to see what JAR files are included as a web library
dependency:
Also,
you can add JAR files as a web library dependency by clicking
Add: