Solved

How to use META-INF/MANIFEST.MF for the .jar ?

Posted on 2006-07-03
6
1,681 Views
Last Modified: 2012-05-05
How to use META-INF/MANIFEST.MF for the .jar ?

I already hava a .jar file done by someone earlier ?
This .jar have several main classes but I know the one I have to use .

Now I have to develop another .jar file (some classes) for which I need this .jar in the classpath ???

But for my .jar to work, I need to invoke the main class from the other .jar (Confusing :)

How can I utilize MANIFEST.MF ...

Let me knw..


_Esam..
0
Comment
Question by:_Esam
6 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 40 total points
ID: 17032611
You need to include the called jar in the

Class-Path

entry in the calling jar
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 17032618
0
 

Author Comment

by:_Esam
ID: 17032965
Not clear... !!!

>You need to include the called jar in the

Class-Path

entry in the calling jar

Confusing...

Pls clarify !

Thax.
_Esam
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 23

Assisted Solution

by:Ajay-Singh
Ajay-Singh earned 40 total points
ID: 17033084
let say the name of the jar file that is developed by someone else is lib.jar,
your jar file name is abc.jar and you want to invoke the main class "a.b.Main"
that is there in lib.jar, You can do this as -

java -classpath lib.jar:abc.jar a.b.Main
0
 
LVL 92

Assisted Solution

by:objects
objects earned 20 total points
ID: 17033931
theres a discussion of the process here thaty may help:

http://www.javalobby.org/forums/thread.jspa?threadID=15486&tstart=45

for example if the other required jar was a.jar and it was in the same directory as your application jar you would add the follwoing to your manifest:

Class-Path: a.jar

You cannot specify the absolute location of the jar, it needs to be the location relative to the application jar
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 17053997
:-)
0

Featured Post

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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to see all occupied ports on windows 10 laptop 15 82
printf performancy 11 83
Cisco ASA: Java web start no go, asdm launcher no go 3 57
dao vs facade design patterns 2 29
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
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…
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:
This video teaches viewers about errors in exception handling.

713 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