Solved

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

Posted on 2013-01-24
8
303 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
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 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

Technology Partners: 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!

Question has a verified solution.

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

Suggested Solutions

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

738 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