Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » User Library not visible in project(User Library added to Java-Buildpath is not visible when trying to add to the projects Libraries)
User Library not visible in project [message #1006839] Sat, 02 February 2013 18:06 Go to next message
Ulrich Schmidt is currently offline Ulrich SchmidtFriend
Messages: 11
Registered: January 2013
Junior Member
I've added Equinox to "Window-Preferences-Java-BuildPath-UserLibraries" as "External Jar" under the Name "Equinox". But when trying to add it to a specific Java Project by:
BuildPath-AddLibraries the name "Equinox" is not seen in the list of choosable libraries.
I'm running Eclipse Juno Service Release 1 and Windows 7 Home.
Any idea what might be wrong?
Ulrich
Re: User Library not visible in project [message #1006868 is a reply to message #1006839] Sun, 03 February 2013 05:17 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26281
Registered: July 2009
Senior Member
Ulrich,

Are you building plugins? You normally add dependencies in the
MANIFEST.MF for that purpose.

On 02/02/2013 7:06 PM, Ulrich Schmidt wrote:
> I've added Equinox to
> "Window-Preferences-Java-BuildPath-UserLibraries" as "External Jar"
> under the Name "Equinox". But when trying to add it to a specific Java
> Project by:
> BuildPath-AddLibraries the name "Equinox" is not seen in the list of
> choosable libraries.
> I'm running Eclipse Juno Service Release 1 and Windows 7 Home.
> Any idea what might be wrong?
> Ulrich
Re: User Library not visible in project [message #1006963 is a reply to message #1006868] Sun, 03 February 2013 09:17 Go to previous messageGo to next message
Ulrich Schmidt is currently offline Ulrich SchmidtFriend
Messages: 11
Registered: January 2013
Junior Member
Equinox is just a sample. In the meantime I learned, that Eclipse Juno must be setup different compared to its predecessors.
But I'm just working on OSGi-samples and there they setup the project this way.

But I think it's probably a good feature to maintain specific libraries. Instead of adding lots of internal/external jars to each of the projects in a workspace you just name a whole bunch of of such jars and at the "name" to the project.
I like this idea and would like to use it.
Re: User Library not visible in project [message #1006968 is a reply to message #1006963] Sun, 03 February 2013 10:58 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26281
Registered: July 2009
Senior Member
Ulrich,

If you're building OSGi bundles you should use a Plug-in project not
just a Java project and you should add dependencies via the MANIFEST.MF;
there's a Convert->Convert to Plug-inProject... on the context menu of a
Java project for converting it. Then you never had to worry about where
those bundles are physically located.


On 03/02/2013 10:17 AM, Ulrich Schmidt wrote:
> Equinox is just a sample. In the meantime I learned, that Eclipse Juno
> must be setup different compared to its predecessors.
> But I'm just working on OSGi-samples and there they setup the project
> this way.
>
> But I think it's probably a good feature to maintain specific
> libraries. Instead of adding lots of internal/external jars to each of
> the projects in a workspace you just name a whole bunch of of such
> jars and at the "name" to the project.
> I like this idea and would like to use it.
>
Re: User Library not visible in project [message #1007009 is a reply to message #1006968] Sun, 03 February 2013 20:34 Go to previous messageGo to next message
Ulrich Schmidt is currently offline Ulrich SchmidtFriend
Messages: 11
Registered: January 2013
Junior Member
You are right, OSGi dependencys are defined in the MANIFEST-file, I don't doubt this. But my point here is not a question about OSGi but a question about an Eclipse-feature. Neil Bartlett describes the setup to run a Equinox-console from Eclipse in his really most valuable book "OSGi in Practice". And he makes use of the User Libraries exact as I described it in my opening of this thread.

Maybe we should change the sample: To use the Apache Http-classes you need several Apache packages in your classpath. You could define a UserLibrary "Apache HTTP-Client" and just add this UserLibrary to the BuildPath of your projects instead of complete list of packages. This approach has it's drawbacks, but this isn't my problem here either.

I see this feature and would like to be able to use it. And I detected that it doesn't work as expected (and described above) so I would like to know what I might have done wrong or whether there is a bug in Eclipse.
Re: User Library not visible in project [message #1007028 is a reply to message #1007009] Mon, 04 February 2013 06:33 Go to previous messageGo to next message
Ulrich Schmidt is currently offline Ulrich SchmidtFriend
Messages: 11
Registered: January 2013
Junior Member
Sorry I phrased these words without really thinking. You are not rigth. In the MANIFEST.MF you the the OSGi-Server the RunPath you need. The BuildPath still has to be defined to your development enviroment; either explicitely the complete CLASSPATH for compiling with javac or implicitely as BuildPath in you IDE (for editing and compiling).

Ulrich Schmidt wrote on Sun, 03 February 2013 15:34
You are right, OSGi dependencys are defined in the MANIFEST-file, I don't doubt this.
...
Re: User Library not visible in project [message #1007029 is a reply to message #1007028] Mon, 04 February 2013 06:53 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26281
Registered: July 2009
Senior Member
Ulrich,

When working with OSGi in Eclipse, if there are external libraries you
need and aren't already made available as bundles in your PDE target
platform, you generally put them in a project with a PDE nature, ensure
that you put those libraries on the runtime path (via the MANIFEST.MFs
Runtime tab's Classpath) and that you export the packages you want to be
visibe to other bundles (via the Runtime tab's Exported Packages). Once
you've done that, in every project where you want to use those
libraries, you use the MANIFEST.MF's Dependencies tab to either
specified your Required Plug-ins or the Imported Packages. This is how
you specify what the bundles make available and what they require be
available at runtime. From this information the PDE can automatically
compute your classpath for development time. With this approach you
never manage the classpath manually, you only manage the Runtime and the
Dependencies of your MANIFEST.MFs. It's totally convenient and I use
this approach even when I'm not developing plug-ins. I'll continue to
suggest you do the same.


On 04/02/2013 7:33 AM, Ulrich Schmidt wrote:
> Sorry I phrased these words without really thinking. You are not
> rigth. In the MANIFEST.MF you the the OSGi-Server the RunPath you
> need. The BuildPath still has to be defined to your development
> enviroment; either explicitely the complete CLASSPATH for compiling
> with javac or implicitely as BuildPath in you IDE (for editing and
> compiling).
>
> Ulrich Schmidt wrote on Sun, 03 February 2013 15:34
>> You are right, OSGi dependencys are defined in the MANIFEST-file, I
>> don't doubt this. ...
>
Re: User Library not visible in project [message #1007042 is a reply to message #1007029] Mon, 04 February 2013 08:36 Go to previous message
Ulrich Schmidt is currently offline Ulrich SchmidtFriend
Messages: 11
Registered: January 2013
Junior Member
Hello Ed,
again: There is a feature called UserLibrary in the Eclipse Software. I tried to use it but it doesn't seem to work. What can I do about it.
This is not a question about OSGi or whatever. Just a (probably) simple Eclipse-problem.
Ulrich
Previous Topic:Where to find package logos
Next Topic:Block caret setting in eclipse
Goto Forum:
  


Current Time: Thu Dec 18 18:24:53 GMT 2014

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

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