This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Java in General and the fly likes jar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Java in General
Bookmark "jar" Watch "jar" New topic


Ruslan Ivanov
Ranch Hand

Joined: Feb 22, 2001
Posts: 72
I followed the direction on sun's site how to create executable jar file but i didn't get far i get an error when trying to run the jar file.
What i did was after creating jar file i modifed the manifest file to have an entry for Main-Class: myClass
but when running the jar file i get no main class is found. What can cause this? Can this be effected by a classpath ? Do i have to include a classpath information into manifest entry?
Barry Andrews
Ranch Hand

Joined: Sep 05, 2000
Posts: 523

How are you trying to run the jar file? From command line? Can you give exactly what you typed in? Also, I don't know if this makes a difference, but I think you need to create the manifest file before making the jar. Give some more information, and I will try to help.
Ruslan Ivanov
Ranch Hand

Joined: Feb 22, 2001
Posts: 72
thanks for replying i solved the problem.
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Don't hold out on us, what was the solution?
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: jar
It's not a secret anymore!