Solved

how to call 3rd party jar that exist in lib directory of the main class  jar

Posted on 2013-01-24
8
283 Views
Last Modified: 2013-03-01
hi,

I have created custom.jar and inside custom.jar there is lib directory where placed 3rd party jars.but Test class inside in custom.jar is not picking up 3rd party jars that exist in lib directory.how to resolve this issue?

custom.jar
|
|
lib ----
		|
		log4j.jar
		

		manifest file.		
		
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.1
Created-By: 17.0-b17 (Sun Microsystems Inc.)
Main-Class: com.sample.Test
Class-Path: lib/log4j.jar

Open in new window

0
Comment
Question by:chaitu chaitu
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 26

Expert Comment

by:ksivananth
ID: 38813958
just add that jar into classpath!
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 38814015
in the manifest file its there right..this jar is located inside the lib directory custom.jar.so jar inside jar.

Class-Path: lib/log4j.jar
0
 
LVL 26

Expert Comment

by:ksivananth
ID: 38814023
I don't think jar inside jar will work, you may want to extract it out.
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 38814035
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 26

Expert Comment

by:ksivananth
ID: 38814047
probably!
0
 
LVL 16

Assisted Solution

by:Valeri
Valeri earned 250 total points
ID: 38814265
yes, one-jar is what you need! :-)
As I know it is plugin for Maven, but I think that you can use it with Ant as well...
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 250 total points
ID: 38814500
As I know it is plugin for Maven, but I think that you can use it with Ant as well...
It's  Maven 'Shade' you're thinking of. If you're using Eclipse, simply include your jar as a dependent library and its export facility will create a 'fat jar'
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 38941623
:)
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now