<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: Can I share the classes from jar in my project with my dependent projects</title><link>https://answers.axonivy.com/questions/1021/can-i-share-the-classes-from-jar-in-my-project-with-my-dependent-projects</link><description>&lt;p&gt;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. &lt;/p&gt;
&lt;p&gt;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. &lt;/p&gt;
&lt;p&gt;But I can't re-use the classes from the third party junit library. Did I miss something?&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/1021/can-i-share-the-classes-from-jar-in-my-project-with-my-dependent-projects" rel="self"></atom:link><language>en</language><lastBuildDate>Thu, 23 Oct 2014 15:10:22 -0400</lastBuildDate><item><title>Answer by HaraldWeber</title><link>https://answers.axonivy.com/questions/1021/can-i-share-the-classes-from-jar-in-my-project-with-my-dependent-projects/1023</link><description>&lt;p&gt;You have to add the library to the Java Build Path in your project.&lt;/p&gt;
&lt;p&gt;Open the java perspective -&amp;gt; Right click on your project -&amp;gt; Properties -&amp;gt; Java Build Path&lt;/p&gt;
&lt;p&gt;There you can add .jar files from projects in your workspace&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">HaraldWeber</dc:creator><pubDate>Thu, 23 Oct 2014 15:10:22 -0400</pubDate><guid>https://answers.axonivy.com/questions/1021/can-i-share-the-classes-from-jar-in-my-project-with-my-dependent-projects/1023</guid></item><item><title>Answer by Reguel Wermelinger</title><link>https://answers.axonivy.com/questions/1021/can-i-share-the-classes-from-jar-in-my-project-with-my-dependent-projects/1022</link><description>&lt;p&gt;The third party library must be exported to the classpath in order to be accessible in the dependee project. 
Proceed as follows: &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;go to the Java Perspective&lt;/li&gt;
&lt;li&gt;Open the context menu of the "base" project with a right click on it&lt;/li&gt;
&lt;li&gt;Go to the "Java Build Path" section&lt;/li&gt;
&lt;li&gt;Tick the export checkbox on the jar that you want to share with other projects&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You can double check this setting in the raw .classpath file. The classpathentry of the thirdparty jar should have the attribute 'exported=true'. &lt;/p&gt;
&lt;p&gt;&lt;img alt="classpath export properties" src="http://answers.axonivy.com/upfiles/exportThirdpartyLibraryToClasspath.png"&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reguel Wermelinger</dc:creator><pubDate>Thu, 23 Oct 2014 15:04:57 -0400</pubDate><guid>https://answers.axonivy.com/questions/1021/can-i-share-the-classes-from-jar-in-my-project-with-my-dependent-projects/1022</guid></item></channel></rss>