Solved

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

Posted on 2006-07-03
6
1,655 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
eclipse compiler vs Installed JREs option 3 77
java 8 lambda expresssions exception handling 3 75
Java Timer (static) 9 36
web services creation SOAP vs REST 5 20
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
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 …
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.

895 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

16 Experts available now in Live!

Get 1:1 Help Now