File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 38087
    
  22
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: 38087
    
  22
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: 38087
    
  22
You're welcome
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8805
    
    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.)
 
 
subject: runnable jar manifest file problem
 
Similar Threads
Application runs only inside WSAD
jar in Jdk 1.7
can anyone give me link to learn detail about Manifest file jar files
Executing a jar file from desktop
refering a property file in the manifest