Solved

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

Posted on 2006-07-03
6
1,644 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
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:

747 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

8 Experts available now in Live!

Get 1:1 Help Now