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 Executing a class in a Jar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Executing a class in a Jar" Watch "Executing a class in a Jar" New topic
Author

Executing a class in a Jar

Srihari Injeti
Ranch Hand

Joined: Jan 05, 2001
Posts: 31
I would like to execute a compiled class which is part of a jar from command line. The class has a main method.


Srihari Injeti<BR>SCJP2 MCP CIW
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Create a manifest and get it into the jar also. The manifest is what gives the JVM a clue as to which class to look in to find the main method.


"JavaRanch, where the deer and the Certified play" - David O'Meara
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
You may want to take a look at this introduction to creating an executable JAR file.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Executing a class in a Jar