Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Java library path set for AST View
Java library path set for AST View [message #1718450] Wed, 23 December 2015 21:20 Go to next message
Williams Mising name is currently offline Williams Mising nameFriend
Messages: 60
Registered: July 2009
Member
I have an AST parser project done before and I have it migrate into Luna. But I found the way I set up before is painful. I need to re set up the path for each jar file under the "Libraries" tab. For instance, I need to add Jar for each jar file like:

org.eclipse.core.runtime_3.10.0.v20140318-2214.jar

To remove the pain I have right now in the future for the Eclipse's upgrade, can I have the following jar only instead of the above detailed file name:

org.eclipse.core.runtime.jar

Also, in order to have a project export to another Eclipse environment, how can I set up the library path so these jar files can be AUTOMATICALLY found in the new environment?
Thanks a lot in advance.
Re: Java library path set for AST View [message #1718467 is a reply to message #1718450] Thu, 24 December 2015 08:09 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33216
Registered: July 2009
Senior Member
Personally I never set up a plain Java project, even if I'm creating a
jar that has to run standalone. I always make sure to use a project
with a PDE nature and let PDE manage the classpath via bundle
dependencies. You can try that via the context menu of the project
using Configure -> Convert to Plug-in projects. Then you can manage
the classpath via the MANIFEST.MF's
Dependencies tab. Then the .classpath will look something like this:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>

If I have extra jars not available as bundles at Eclipse that I want on
the classpath, I put them in a plugin project and add them via the
Runtime tab of the MANIFEST.MF so that they're on the classpath for that
project and then my other projects can depend on that bundle.

On 23/12/2015 10:20 PM, Williams Mising name wrote:
> I have an AST parser project done before and I have it migrate into
> Luna. But I found the way I set up before is painful. I need to re set
> up the path for each jar file under the "Libraries" tab. For instance,
> I need to add Jar for each jar file like:
>
> org.eclipse.core.runtime_3.10.0.v20140318-2214.jar
>
> To remove the pain I have right now in the future for the Eclipse's
> upgrade, can I have the following jar only instead of the above
> detailed file name:
>
> org.eclipse.core.runtime.jar
>
> Also, in order to have a project export to another Eclipse
> environment, how can I set up the library path so these jar files can
> be AUTOMATICALLY found in the new environment?
> Thanks a lot in advance.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Java library path set for AST View [message #1718495 is a reply to message #1718467] Thu, 24 December 2015 21:52 Go to previous messageGo to next message
Williams Mising name is currently offline Williams Mising nameFriend
Messages: 60
Registered: July 2009
Member
Thanks, Ed. It does help. But when I try to add org.eclipse.text in the dependencies tab, the file does not show up. How can I deal with this jar file?

As of the second part, is there any online tutorial I can follow? I dont have a bundle outside Eclipse but I would like to give a try.

Merry Christmas and Happy Holiday to Ed and all of you reading this topic.
Re: Java library path set for AST View [message #1718551 is a reply to message #1718495] Sun, 27 December 2015 05:56 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33216
Registered: July 2009
Senior Member
Is the Plug-in Selection dialog empty or does it just not contain all
the plug-ins you're expecting?

I'm not sure which tutorial is best. I'd have to Google that:

https://www.google.com/search?q=eclipse+bundle+external+library

On 24/12/2015 10:52 PM, Williams Mising name wrote:
> Thanks, Ed. It does help. But when I try to add org.eclipse.text in
> the dependencies tab, the file does not show up. How can I deal with
> this jar file?
>
> As of the second part, is there any online tutorial I can follow? I
> dont have a bundle outside Eclipse but I would like to give a try.
>
> Merry Christmas and Happy Holiday to Ed and all of you reading this
> topic.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Java library path set for AST View [message #1718574 is a reply to message #1718551] Sun, 27 December 2015 16:07 Go to previous messageGo to next message
Williams Mising name is currently offline Williams Mising nameFriend
Messages: 60
Registered: July 2009
Member
When I type some keyword such as osgi in the Plug-in Selection under "Required Plug-ins" ->Add, it does not show org.eclipse.osgi. See the attached image.
But It does show up in the Plugin Selection under "Automated Management of Dependencies" -> Add. At the moment, I add those plugins under "Automated Management of Dependencies". Is my Eclipse not set up appropriately? Thanks.
index.php/fa/24430/0/
  • Attachment: missing.jpg
    (Size: 223.40KB, Downloaded 755 times)
Re: Java library path set for AST View [message #1718595 is a reply to message #1718574] Mon, 28 December 2015 05:23 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33216
Registered: July 2009
Senior Member
Once it's in one of the two lists, you won't be able to add it again.
Also, if an already required plug-in exports a requirement that it
imports, PDE won't offer that choice. E.g., if you import
org.eclipse.core.runtime (as you have), it won't offer the
org.eclipse.osgi choice (and a bunch of other things). Note you can
double click any dependency to open its MANIFEST.MF editor to see what
it requires and which of those requirements it reexports; those will be
filtered from the choices of additional things to add.

On 27/12/2015 5:07 PM, Williams Mising name wrote:
> When I type some keyword such as osgi in the Plug-in Selection under "Required Plug-ins" ->Add, it does not show org.eclipse.osgi. See the attached image.
> But It does show up in the Plugin Selection under "Automated Management of Dependencies" -> Add. At the moment, I add those plugins under "Automated Management of Dependencies". Is my Eclipse not set up appropriately? Thanks.
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Java library path set for AST View [message #1718790 is a reply to message #1718595] Wed, 30 December 2015 11:03 Go to previous messageGo to next message
wijnaldum william is currently offline wijnaldum williamFriend
Messages: 1
Registered: December 2015
Junior Member
Instead, go into the library settings for your projects and, for each jar/etc that requires a native library, expand it in the Libraries tab. In the tree view there, each library has items for source/javadoc and native library locations.

Specifically: select Project, right click -> Properties / Java Build Path / Libraries tab, select a .jar, expand it, select Native library location, click Edit, folder chooser dialog will appear)

Messing with the library path on the command line should be your last ditcheffort, because you might break something that is already properly set by eclipse.
Re: Java library path set for AST View [message #1718835 is a reply to message #1718790] Wed, 30 December 2015 22:16 Go to previous messageGo to next message
Williams Mising name is currently offline Williams Mising nameFriend
Messages: 60
Registered: July 2009
Member
When I expand *.jar files, it seems that they all None for the native library locations and source/javadoc.

What do you mean " messing with the library path on the command line..." I didnt use any command line in my project.
Re: Java library path set for AST View [message #1719672 is a reply to message #1718835] Mon, 11 January 2016 09:58 Go to previous messageGo to next message
Louie Beckham is currently offline Louie BeckhamFriend
Messages: 1
Registered: January 2016
Junior Member
Don't mess with the library path! Eclipse builds it itself!

Instead, get in the library settings for your comes and, for every jar/etc that needs a native library, expand it within the Libraries tab. within the tree read there, every library has things for source/javadoc and native library locations.

Specifically: choose Project, right click -&gt; Properties / Java Build Path / Libraries tab, select a .jar, expand it, choose Native library location, click Edit, folder somebody dialog can appear)

Messing with the library path on the instruction ought to be your last ditch effort, as a result of you may break one thing that's already properly set by eclipse.
Thanks , Smile

Re: Java library path set for AST View [message #1721953 is a reply to message #1719672] Mon, 01 February 2016 20:44 Go to previous message
Williams Mising name is currently offline Williams Mising nameFriend
Messages: 60
Registered: July 2009
Member
After several tries, I found my previous problem still exists, namely manually changing path setting from one eclipse to another one. For instance, I add org.eclipse.jdt.core(3.11.1) via the dependency tab under PDE in one computer. But when I import the same project to another computer with a different version of jdt.core (say 3.10.1), I also need to manually delete the previous one and add a new one. Is there anyway I can let each Eclipse automatically adds the required Plug-in based on its setting? Thanks.
Previous Topic:Creating a new Eclipse project with a Git repository
Next Topic:No console output of comma
Goto Forum:
  


Current Time: Sat Sep 21 12:50:35 GMT 2024

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

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

Back to the top