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 how to start a specific class in a package? 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 "how to start a specific class in a package?" Watch "how to start a specific class in a package?" New topic
Author

how to start a specific class in a package?

D. Formenton
Ranch Hand

Joined: Mar 20, 2008
Posts: 47
Dear Sirs,

I have a .jar package with several form (form1, form2, etc.) where each form has a main() function.

The question is: it is possible to select at run time the form to be started?
I.e. it exist a command like "java -jar mypackage.jar ...???" that permit to start a particular form?

thank you

Domenico
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18101
    
  39

Well, one option is to not use the "-jar" option, and call the class directly...

java -cp mypackage.jar Form1

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to start a specific class in a package?
 
Similar Threads
How to deploy a GUI Swing application?
jar and RMI don�t work?
add jar file to classpath programmatically
WAS Server startup fails with Initialization error
create JAR