Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I add build path items to Eclipse 3.5 using relative paths?

Tags:

Eclipse 3.5 added support for relative buildpath/classpath items, yet I cannot seem to find a graphical way to add relatively pathed items. The example in new and noteworthy (search the page for 'relative', about 40% of the way down) seems to indicate that I have to manually edit the .classpath file. Am I just missing something?

Edit 2015: Updated link as it had went away. To preserve the "new and noteworthy" indefinitely, here's a screenshot of the mentioned section.

enter image description here

like image 561
basszero Avatar asked Sep 15 '09 13:09

basszero


People also ask

How to set build path in Eclipse IDE?

How to set build path in eclipse IDE? Proper build path is required for compiling and building java project. 1. Right Click on your project folder, Choose Build Path > Configure Build Path For both cases you will find the same option panel like: 2. Select “JRE System Library” and select Edit from the right side bar

What is the Java build path?

The Java build path is used while compiling a Java project to discover dependent classes. It is made up of the following items − Code in the source folders. Jars and classes folder associated with the project.

How do I add jars to the Eclipse build path?

On the left hand side tree select Java Build Path. A common requirement seen while developing java applications is to add existing jars to the java build path. This can be accomplished using the Libraries tab. In the Libraries tab, just click on Add JARs if the jar is already in the Eclipse workspace or click on Add...

How do I change the build path of a JRE project?

1 Right Click on your project folder, Choose Build Path > Configure Build Path Or Right Click on your project folder, Choose Property > Java Build Path For both cases ... 2 Select “JRE System Library” and select Edit from the right side bar 3 Choose your right Version of java installed


1 Answers

The actual way to do this is to import the library into your workspace so,

Right Click in Package Explorer -> Import -> File System -> Browse (to the directory containing your jars) -> check the boxes next to the jars you want -> Browse to the workspace folder you want to import to (probably your lib folder) -> Finish

Keep in mind this will copy the files into the lib folder so I've found that it helps keep things clean if you don't already have them in there. They will now show up in the package explorer under "lib." To add them to the classpath,

Right click on the project -> Build Path -> configure build path... -> Add JARs -> navigate to the given project's lib folder and select the appropriate JARs -> click ok -> click finish

This adds them to the CP with relative locations.

If you need more help let me know

like image 54
Chris Thompson Avatar answered Nov 07 '22 20:11

Chris Thompson