aspose file tools*
The moose likes Beginning Java and the fly likes runnable jar manifest file problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "runnable jar manifest file problem" Watch "runnable jar manifest file problem" New topic
Author

runnable jar manifest file problem

Yoav Weiss
Greenhorn

Joined: Nov 20, 2008
Posts: 11
is there a way of having the default manifest (that is - the empty one) , and still be able to run the main function which is located in a class inside the jar, by applying these values by the command line?

i tried building a jar manually , and even creating a manifest file with an entry point just for the practice (rather then using the eclipse tool) , but it keep on giving me the NoClassDefFoundError exception.

any idea? it's really starting to bug me

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39834
    
  28
To the Java Tutorials! And this page too!

I have only looked at those pages for a very short time, but it appears the answer is, no.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39834
    
  28
Are you using Eclipse? It is very easy to add a main class when you create a .jar in Eclipse. Altering the classpath is harder; last time I tried I ended up doing it by hand.
Yoav Weiss
Greenhorn

Joined: Nov 20, 2008
Posts: 11
Well , i am using eclipse, but i solved the problem.
it appears that there is an option of creating a simple jar by console - so it's manifest is actually empty, but apply it the classpath for external jars i am using, and parameters for location of main function and input params as well.
much to my surprise it all worked out well.

my team leader sorted it out for me after about two days of me being all .

anyway ,thanks for all the help
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39834
    
  28
You're welcome
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8883
    
    5
we're done here, but I would have thrown this to the intermediate forum if I'd seen it earlier


Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
 
jQuery in Action, 2nd edition
 
subject: runnable jar manifest file problem