prosseek
prosseek

Reputation: 191179

How to put eclipse jdt jar libraries in Java Build Path?

enter image description here

I'm trying to use eclipse jdt, and I tried to import related modules in java source file.

I have a bunch of errors as the jdt libraries are not in Java Build Path.

enter image description here

I tried to open Add Libary -> Plug-in Dependencies, but it doesn't have the jdt jar files.

enter image description here

I could use Add External JARs to point to all the jar files, but I don't think it's a good idea considering I have to do the same thing over and over again with new projects.

In this case, how to put eclipse jdt jar libraries in Java Build Path? The java.util.Collection is found automatically. I guess there might be some easy way to setup so that jdt jar files are found automatically.

Upvotes: 4

Views: 2790

Answers (3)

prosseek
prosseek

Reputation: 191179

Normally, I had to use eclipse plugin for using jdt for accessing the files in the workspace, and getting the jar files and such.

However, I found this solution to be very useful for using jdt/ask. The idea is to use string as an input to the jet, and import the related jars for using the jdt APIs.

http://www.programcreek.com/2011/01/a-complete-standalone-example-of-astparser/

I had to open Configure Build Path.

enter image description here

Then, I could select and import all the jar files that I downloaded from the site.

enter image description here

Now, I am ready to use the libraries.

enter image description here

Upvotes: 1

shyam
shyam

Reputation: 9368

Assuming your project is an eclipse plugin project you can add the jdt as a dependency and the jars will be automatically added to the plugin dependencies jdt

Upvotes: 1

Yogendra Singh
Yogendra Singh

Reputation: 34397

In you Java Build Path screen, you notice two bottons Add Variable and Add Liberary below Add External Jars. Use those options and define a new variable or new user library; Once done, add the same in the project build path.

For newer project, you can simply reuse the variable/user library.

java.util.Collection is found as it is added as library in your build path(see first item in your screenshot). I am suggesting to do the same by introducing an User Library.

Upvotes: 0

Related Questions