Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » how do I set a project's classpath
how do I set a project's classpath [message #1000586] Mon, 14 January 2013 22:58 Go to next message
Pat Farrell is currently offline Pat Farrell
Messages: 8
Registered: November 2009
Location: Outside Washington DC
Junior Member
I'm new to Eclipse, but not to Java or IDEs in general.

I can't figure out how to create a "lib" directory, parallel to the 'src' and 'bin' directories and have Eclipse look there for the bunches of jar files that I use. I use a bunch, i.e. Google Guava, a JDBC, Log4J, etc. I want to set the whole directory as a classpath place. It seems to work when I add each .jar one at a time, but that is a bit tedious.

It may be that I'm just not seeing it, or perhaps Juno has changed it, as googling in the usual places such as stackoverflow or javaranch isn't helping.

I'm sure this is easy once I know where to look

Running
Version: Juno Service Release 1
Build id: 20121004-1855
on OS-X

Thanks
Re: how do I set a project's classpath [message #1000600 is a reply to message #1000586] Mon, 14 January 2013 23:48 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin Dahyabhai
Messages: 2228
Registered: July 2009
Senior Member
I believe that when adding jar files yourself, the dialog does allow for multi-select, as alluded to by the label.

---
Nitin Dahyabhai
Eclipse WTP, IBM
Re: how do I set a project's classpath [message #1000611 is a reply to message #1000586] Tue, 15 January 2013 00:12 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 25907
Registered: July 2009
Senior Member
Pat,

It's usually much easier to use PDE to manage the classpath, even if you
aren't building Eclipse plug-ins. Then you could set up a Plug-in
project with all your libraries and any other project that needs them
can just add a dependency to that "library" bundle/plug-in...


On 15/01/2013 4:58 AM, Pat Farrell wrote:
> I'm new to Eclipse, but not to Java or IDEs in general.
>
> I can't figure out how to create a "lib" directory, parallel to the
> 'src' and 'bin' directories and have Eclipse look there for the
> bunches of jar files that I use. I use a bunch, i.e. Google Guava, a
> JDBC, Log4J, etc. I want to set the whole directory as a classpath
> place. It seems to work when I add each .jar one at a time, but that
> is a bit tedious.
>
> It may be that I'm just not seeing it, or perhaps Juno has changed it,
> as googling in the usual places such as stackoverflow or javaranch
> isn't helping.
>
> I'm sure this is easy once I know where to look
>
> Running
> Version: Juno Service Release 1
> Build id: 20121004-1855
> on OS-X
>
> Thanks
Re: how do I set a project's classpath [message #1000614 is a reply to message #1000600] Tue, 15 January 2013 00:22 Go to previous messageGo to next message
Pat Farrell is currently offline Pat Farrell
Messages: 8
Registered: November 2009
Location: Outside Washington DC
Junior Member
OK, but how do I do it, so that I can specify a folder as part of the classpath?

THanks
Re: how do I set a project's classpath [message #1000615 is a reply to message #1000611] Tue, 15 January 2013 00:23 Go to previous messageGo to next message
Pat Farrell is currently offline Pat Farrell
Messages: 8
Registered: November 2009
Location: Outside Washington DC
Junior Member
Ed Merks wrote on Tue, 15 January 2013 00:12
It's usually much easier to use PDE to manage the classpath, even if you aren't building Eclipse plug-ins. Then you could set up a Plug-in project with all your libraries and any other project that needs the m can just add a dependency to that "library" bundle/plug-in...


Thanks

What is a PDE? How do I use it? link to an explanation? How do I learn about it? etc.?
Re: how do I set a project's classpath [message #1000628 is a reply to message #1000615] Tue, 15 January 2013 00:50 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 25907
Registered: July 2009
Senior Member
Pat,

Google "Eclipse PDE". Using "New->Configure->Convert to Plug-in
Project" lets you convert existing Java projects to plug-ins. It will
created a MANIFEST.MF. When you edit that for your Library project, the
Runtime tab will let you specify the libraries (or packages in your Java
source you want available in other bundles). From then on, you can use
the Dependencies tabs to specify dependencies on other plug-ins and the
PDE will set up the classpath automatically. You might need to do (from
the context menu of a project) PDE Tools-> Update Classpath the first
time...


On 15/01/2013 6:23 AM, Pat Farrell wrote:
> Ed Merks wrote on Tue, 15 January 2013 00:12
>> It's usually much easier to use PDE to manage the classpath, even if
>> you aren't building Eclipse plug-ins. Then you could set up a
>> Plug-in project with all your libraries and any other project that
>> needs the m can just add a dependency to that "library"
>> bundle/plug-in...
>
>
> Thanks
>
> What is a PDE? How do I use it? link to an explanation? How do I learn
> about it? etc.?
Re: how do I set a project's classpath [message #1001012 is a reply to message #1000628] Tue, 15 January 2013 16:15 Go to previous messageGo to next message
Pat Farrell is currently offline Pat Farrell
Messages: 8
Registered: November 2009
Location: Outside Washington DC
Junior Member
Ed Merks wrote on Tue, 15 January 2013 00:50
Google "Eclipse PDE".
Using "New->Configure->Convert to Plug-in
Project" lets you convert existing Java projects to plug-ins.


I googled and found it, but it seems to be about creating and developing plugins. All I want to do is have a small number of Java projects that have a folder in the classpath. That seems like a huge jump to developing plugins.

Am I missing something?
Thanks
Re: how do I set a project's classpath [message #1001176 is a reply to message #1001012] Wed, 16 January 2013 02:42 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 25907
Registered: July 2009
Senior Member
Pat,

I explained pretty much all you need to do. The point isn't to develop
plug-ins but rather to let PDE manage your classpaths. If you'd rather
do that manually, that's fine and your choice.

On 15/01/2013 10:15 PM, Pat Farrell wrote:
> Ed Merks wrote on Tue, 15 January 2013 00:50
>> Google "Eclipse PDE". Using "New->Configure->Convert to Plug-in
>> Project" lets you convert existing Java projects to plug-ins.
>
>
> I googled and found it, but it seems to be about creating and
> developing plugins. All I want to do is have a small number of Java
> projects that have a folder in the classpath. That seems like a huge
> jump to developing plugins.
>
> Am I missing something?
> Thanks
Previous Topic:Saros Plugin on Windows 8
Next Topic:Problems with Starting a Project
Goto Forum:
  


Current Time: Tue Jul 22 03:25:32 EDT 2014

Powered by FUDForum. Page generated in 0.01982 seconds