?
Solved

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

Posted on 2013-01-24
8
Medium Priority
?
311 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 20

Author Comment

by:chaitu chaitu
ID: 38814035
0
 
LVL 26

Expert Comment

by:ksivananth
ID: 38814047
probably!
0
 
LVL 16

Assisted Solution

by:Valeri
Valeri earned 750 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 750 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Suggested Courses
Course of the Month9 days, 6 hours left to enroll

762 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