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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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]
 
jQuery in Action, 2nd edition
 
subject: Executing a class in a Jar
 
Similar Threads
how can we make a jar file
java.sql.SQLException: No suitable driver
ClassNotFoundException
problem in developing jasper report in BEA workspace studio version 1.1 with weblogic server 10.0
org.hibernate.HibernateException: No TransactionManagerLookup specified