Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Runtime Classpath in Eclipse(runtime vs compile time classpath in eclipse)
Runtime Classpath in Eclipse [message #507303] Tue, 12 January 2010 21:16 Go to next message
Russ is currently offline Russ
Messages: 5
Registered: January 2010
Junior Member
I've been using eclipse for a while now and have never had a for sure answer one way or the other on this question - we just keep putting things under the build path/ libraries tab and things just work.

Let's assume you have a java project called "Project". I have a third party jar called "MyJar.jar"

How can I add this jar to the run-time classpath?

How can I add this jar to the compile-time classpath?

In eclipse can I actually add a jar to only one or the other? If so, how?

Are there any articles or documentation that go over the most common format for web projects ie (An ear, 1 or more web projects, 1 or more java projects that become utility jar's for the web projects) and what all of the steps are you have to do to correctly set things up and why?

I'm looking for exact definitions of when you add something to the "Java Module Dependencies" section.

Exact definitions of when you would add something to the project tab under "java build path" or when you add jar's under the libraries tab under "java build path" and what the ramifications are, etc.

Thanks in advance for anyone bearing with me. I would really like to find some good documentation on this type of thing.
Re: Runtime Classpath in Eclipse [message #507318 is a reply to message #507303] Tue, 12 January 2010 22:07 Go to previous messageGo to next message
Eric Rizzo is currently offline Eric Rizzo
Messages: 2327
Registered: July 2009
Senior Member
On 1/12/10 4:16 PM, Russ wrote:
> I've been using eclipse for a while now and have never had a for sure
> answer one way or the other on this question - we just keep putting
> things under the build path/ libraries tab and things just work.
>
> Let's assume you have a java project called "Project". I have a third
> party jar called "MyJar.jar"
>
> How can I add this jar to the run-time classpath?
>
> How can I add this jar to the compile-time classpath?
>
> In eclipse can I actually add a jar to only one or the other? If so, how?
>
> Are there any articles or documentation that go over the most common
> format for web projects ie (An ear, 1 or more web projects, 1 or more
> java projects that become utility jar's for the web projects) and what
> all of the steps are you have to do to correctly set things up and why?
>
> I'm looking for exact definitions of when you add something to the "Java
> Module Dependencies" section.
>
> Exact definitions of when you would add something to the project tab
> under "java build path" or when you add jar's under the libraries tab
> under "java build path" and what the ramifications are, etc.
>
> Thanks in advance for anyone bearing with me. I would really like to
> find some good documentation on this type of thing.

I'm not a big user of WTP, but is there a reason you wouldn't add the
JARs in the WEB-INF/lib directory? I'm pretty sure that Dynamic Web
projects automatically include every JAR found there on both build path
and runtime classpath.

By the way, questions that are specific to Web Tools (WTP) usually get
more attention on the Web Tools forum group.

Hope this helps,
Eric
Re: Runtime Classpath in Eclipse [message #507431 is a reply to message #507318] Wed, 13 January 2010 13:45 Go to previous messageGo to next message
Russ is currently offline Russ
Messages: 5
Registered: January 2010
Junior Member
Is there any way I can request that this post be moved there? To the Web Tools Forum?
Re: Runtime Classpath in Eclipse [message #507455 is a reply to message #507431] Wed, 13 January 2010 14:54 Go to previous messageGo to next message
Eric Rizzo is currently offline Eric Rizzo
Messages: 2327
Registered: July 2009
Senior Member
Russ wrote on Wed, 13 January 2010 08:45
Is there any way I can request that this post be moved there? To the Web Tools Forum?


Done.
Re: Runtime Classpath in Eclipse [message #507744 is a reply to message #507455] Thu, 14 January 2010 14:24 Go to previous messageGo to next message
Russ is currently offline Russ
Messages: 5
Registered: January 2010
Junior Member
Well my questions still stand. I'm looking for info on how the runtime classpath gets created when you have different structures. IE.

Ear/Web proj (war)/ Java Project (jar)

I did find some documentation that told me how the runtime classpath gets built when you just have a java project. The doc said by default the run-time classpath uses a bootstrap classpath of whatever is on the build path (compile-time classpath) which explains why if you only have a java project and you add a jar to the build path, why it can run as well.
Re: Runtime Classpath in Eclipse [message #508074 is a reply to message #507455] Fri, 15 January 2010 18:46 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin Dahyabhai
Messages: 2314
Registered: July 2009
Senior Member
Eric Rizzo wrote:
> Russ wrote on Wed, 13 January 2010 08:45
>> Is there any way I can request that this post be moved there? To the
>> Web Tools Forum?
>
>
> Done.

I think not. Without the original post being quoted, there's no way
to know what Russ is asking.

--
Nitin Dahyabhai
Eclipse WTP Source Editing
IBM Rational


---
Nitin Dahyabhai
Eclipse WTP, IBM
Re: Runtime Classpath in Eclipse [message #508085 is a reply to message #507744] Fri, 15 January 2010 18:52 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin Dahyabhai
Messages: 2314
Registered: July 2009
Senior Member
Russ wrote:
> Well my questions still stand. I'm looking for info on how the runtime
> classpath gets created when you have different structures. IE.
>
> Ear/Web proj (war)/ Java Project (jar)
>
> I did find some documentation that told me how the runtime classpath
> gets built when you just have a java project. The doc said by default
> the run-time classpath uses a bootstrap classpath of whatever is on the
> build path (compile-time classpath) which explains why if you only have
> a java project and you add a jar to the build path, why it can run as well.

I think you're looking for
org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDel egate#getClasspath(ILaunchConfiguration)
, which is run when Eclipse launches a JVM. JDT actually handles
the conversion of the build path to a runtime classpath; although
someone may implement a classpath container, it's always converted
by JDT.

--
Nitin Dahyabhai
Eclipse WTP Source Editing
IBM Rational


---
Nitin Dahyabhai
Eclipse WTP, IBM
Re: Runtime Classpath in Eclipse [message #508679 is a reply to message #508085] Tue, 19 January 2010 19:45 Go to previous messageGo to next message
Russ is currently offline Russ
Messages: 5
Registered: January 2010
Junior Member
I may be ignorant about something but I don't think this is quite what I'm looking for. Basically I'm trying to find some documentation as to the "rules that will be used to create the run-time classpath" when having an ear / web project / java project structure.

If the answer to this question lies in the JDT documentation, please let me know. Ideally I would love a link or two describing what happens (and maybe why), but this may be more hand holding than is feasible.

Thanks for your time thus far.
Re: Runtime Classpath in Eclipse [message #508901 is a reply to message #508679] Wed, 20 January 2010 16:32 Go to previous messageGo to next message
David M. Karr is currently offline David M. Karr
Messages: 354
Registered: July 2009
Senior Member
Part of the confusion here is that you're starting to cross from the Eclipse domain into the web container domain. In order to understand the runtime classpath, you have to review information in the JEE specification and your container documentation (Tomcat is not the only web container). This mainly requires understanding classloaders and the classloader hierarchy. For instance, jars that go into WEB-INF/lib are treated slightly differently from jars that go into the "lib" directory of the EAR file. This has nothing to do with Eclipse.
Re: Runtime Classpath in Eclipse [message #511429 is a reply to message #508901] Mon, 01 February 2010 15:28 Go to previous message
Russ is currently offline Russ
Messages: 5
Registered: January 2010
Junior Member
Thanks guys, I'll look into it. I didn't know it was going to be related to my "server" (container?) implementation. This should be enough to get me on another rabbit trail. Many thanks.
Previous Topic:Eclipse project backup
Next Topic:Web Module Deployment problem
Goto Forum:
  


Current Time: Thu Oct 30 18:59:28 GMT 2014

Powered by FUDForum. Page generated in 0.02182 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software