Importing external jars [message #179572] |
Thu, 21 September 2006 18:42 |
Eclipse User |
|
|
|
Originally posted by: aaron.esitenow.com
I don't quite understand how Eclipse imports external jars to the build
path. I have imported the jars, they show up in libraries in project
explorer, but it doesn't actually put the jars in web-inf/lib. Even
though I'm not getting any compile errors, Tomcat complains that it
can't find the classes. Do I need to manually import the libraries
myself for each library?
|
|
|
Re: Importing external jars [message #179581 is a reply to message #179572] |
Thu, 21 September 2006 19:09 |
Eclipse User |
|
|
|
Originally posted by: kosta.bea.com
Aaron,
You need to do a bit more work to tell WTP to package the jar into your
web app's web-inf/lib directory. I can walk you through that, but first
let me ask you a couple of questions:
1. Are you trying to avoid copying the jar directly into your web app?
If you are not trying to avoid it, the easiest thing to do is to simply
drag-n-drop the jar into your <pj.dir>/WebContent/WEB-INF/lib directory.
It will be automatically picked up and added to your project's classpath.
2. What version of WTP are you using?
- Konstantin
|
|
|
Re: Importing external jars [message #179631 is a reply to message #179581] |
Thu, 21 September 2006 22:45 |
Eclipse User |
|
|
|
Originally posted by: aaron.esitenow.com
Thanks for the reply. I'm not necessarily trying to avoid it, but I
always try to reduce the number of steps necessary to set a project up.
I just read about user libraries and that looks interesting, but I
don't know if that would solve my problem either. I am using WTP 1.5
and walking through some spring app tutorials.
Konstantin Komissarchik wrote:
> Aaron,
>
> You need to do a bit more work to tell WTP to package the jar into your
> web app's web-inf/lib directory. I can walk you through that, but first
> let me ask you a couple of questions:
>
> 1. Are you trying to avoid copying the jar directly into your web app?
> If you are not trying to avoid it, the easiest thing to do is to simply
> drag-n-drop the jar into your <pj.dir>/WebContent/WEB-INF/lib directory.
> It will be automatically picked up and added to your project's classpath.
>
> 2. What version of WTP are you using?
>
> - Konstantin
|
|
|
|
Re: Importing external jars [message #180648 is a reply to message #180618] |
Thu, 05 October 2006 15:16 |
Eclipse User |
|
|
|
Originally posted by: kosta.bea.com
Niklas,
Here is one of the better ways to do this:
1. Create a generic project (General->Project).
2. Copy your jars into this project and source control the project.
3. Whenever a web app needs to reference one of these jars, go to that
web app's project properties and use the "Add JARs" button on the J2EE
Module Dependencies page.
The jars will be automatically added to your web project's classpath and
now WTP will also know to package them into your WAR's WEB-INF/lib
directory when you export it.
If you don't want to create a project around your jars, then you can use
the "Add External JARs" (puts absolute paths into your project metadata)
or "Add Variable" (requires that the classpath variable that you use is
configured in every team member's workspace).
- Konstantin
|
|
|
|
Powered by
FUDForum. Page generated in 0.03917 seconds