This week's giveaways are in the MongoDB and Jobs Discussion forums.
We're giving away four copies of Mongo DB Applied Patterns and 4 resume reviews from Five Year Itch and have the authors/reps on-line!
See this thread and this one for details.
The moose likes Beginning Java and the fly likes Self executing program Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Self executing program" Watch "Self executing program" New topic
Author

Self executing program

Scotty Steven
Ranch Hand

Joined: Jan 27, 2012
Posts: 67
I have been working on a project that has about 20 different class files, all called from a main menu. I want to make it self executing. How do I do that?
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 5783
    
    5

Scotty Steven wrote:I have been working on a project that has about 20 different class files, all called from a main menu. I want to make it self executing. How do I do that?


What exactly do you mean "self executing"?
Scotty Steven
Ranch Hand

Joined: Jan 27, 2012
Posts: 67
I would like to click on an icon, and it run the program.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 8430

Recommended reading http://docs.oracle.com/javase/tutorial/deployment/jar/appman.html


[Donate a pint, save a life!] [How to ask questions] [Onff-turn it on!]
Scotty Steven
Ranch Hand

Joined: Jan 27, 2012
Posts: 67
So, when it says

Main-Class: MyPackage.MyClass

The MyPackage portion would be the folder that contains all of the class files?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 8430

Scotty Steven wrote:So, when it says

Main-Class: MyPackage.MyClass

The MyPackage portion would be the folder that contains all of the class files?

Not all class files. It should be the package of your main class (which contains the main method)
You can have other classes in different package(s)
Scotty Steven
Ranch Hand

Joined: Jan 27, 2012
Posts: 67
Thanks! I'll go play and let you know the results.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32595
    
    4
. . . and remember you need a blank line at the end of your manifest file.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Self executing program
 
Similar Threads
How to use manifest.mf ?
simple Programee on collection
Running application standalone
Can't find executable Jar file
java database help