Solved

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

Posted on 2013-01-24
8
306 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
Independent Software Vendors: 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 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

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 last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This video teaches viewers about errors in exception handling.

718 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