Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2006-07-03
6
Medium Priority
?
1,709 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 160 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
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.

 
LVL 23

Assisted Solution

by:Ajay-Singh
Ajay-Singh earned 160 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 80 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
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…
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.
Suggested Courses

824 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