I have a project "base" with a custom library e.g. "junit-4.11.jar" on the classpath. Therefore I can use the junit classes within this base project.

In another project called "dependee" I have configured the "base" project as dependency. Therefore I can use classes (e.g. DataClasses) from the "base" project in the "dependee" project.

But I can't re-use the classes from the third party junit library. Did I miss something?

asked 23.10.2014 at 15:00

SupportIvyTeam's gravatar image

SupportIvyTeam ♦♦
1.2k78105116
accept rate: 77%


The third party library must be exported to the classpath in order to be accessible in the dependee project. Proceed as follows:

  1. go to the Java Perspective
  2. Open the context menu of the "base" project with a right click on it
  3. Go to the "Java Build Path" section
  4. Tick the export checkbox on the jar that you want to share with other projects

You can double check this setting in the raw .classpath file. The classpathentry of the thirdparty jar should have the attribute 'exported=true'.

classpath export properties

link

answered 23.10.2014 at 15:04

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦
8.0k11650
accept rate: 69%

You have to add the library to the Java Build Path in your project.

Open the java perspective -> Right click on your project -> Properties -> Java Build Path

There you can add .jar files from projects in your workspace

link

answered 23.10.2014 at 15:10

HaraldWeber's gravatar image

HaraldWeber
101101015
accept rate: 33%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×17

Asked: 23.10.2014 at 15:00

Seen: 1,100 times

Last updated: 23.10.2014 at 15:10