Meaningless Drivel is fun!*
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

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"

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

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]
subject: Executing a class in a Jar
Similar Threads
problem in developing jasper report in BEA workspace studio version 1.1 with weblogic server 10.0
org.hibernate.HibernateException: No TransactionManagerLookup specified
how can we make a jar file
java.sql.SQLException: No suitable driver