Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2006-07-03
6
Medium Priority
?
1,702 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
[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
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
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 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 Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
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:
Suggested Courses

671 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