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.4k102118122
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... ♦♦
9.4k31958
accept rate: 70%

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
(suspended)
accept rate: 33%

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:

×26

Asked: 23.10.2014 at 15:00

Seen: 2,594 times

Last updated: 23.10.2014 at 15:10