Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to use a single manifest to access two main methods? Need Help

843789Jul 21 2010 — edited Jul 21 2010
Hi All

I have 2 classes within same package.Both classes have main method in them. Need to run these two main methods at different instances. I have two cmd files to call these main methods. But it doesn't work when i remotely access the jar since it takes the main method mentioned in the Manifest file "Main-Class: com.ini.vldt.MainMethod1". Is there a way to mention two main methods in the Manifest.

cmd1
-------------
..\..\java\jdk1.5.0_01\bin\java.exe -jar TEST.jar xsl2rdlconversion.MainMethod1

cmd2
-----------
..\..\java\jdk1.5.0_01\bin\java.exe -jar TEST.jar com.ini.vldt.MainMethod2

Even though i run the second cmd it runs the MainMethod1 since the Manifest's main is MainMethod1. It doesn't run MainMethod2. I need to maintain just one JAR file.


Can somebody give me a solution for this please.

Thanks in advance
Madumm
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 18 2010
Added on Jul 21 2010
16 comments
1,750 views