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 Using a Jar File in Dos/Batch Script 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 "Using a Jar File in Dos/Batch Script" Watch "Using a Jar File in Dos/Batch Script" New topic
Author

Using a Jar File in Dos/Batch Script

Paul Wam
Greenhorn

Joined: Apr 05, 2009
Posts: 20
I have a jar file that I successfully run from the windows command line below:


Mathprog.jar invokes a computeXYZ method using 3000 as a argument and outputs a value when finished. That works perfectly.

The problem that I'm having is that mathprog has more than one method and I want to find a way to invoke more methods than computeXYZ from the command line. I'm certain that this is not the proper syntax but what I envision is being able to say something like:
c:\>mathprog.computeABC.jar 8000
c:\>mathprog.computeMNO.jar 500

What's the correct way of doing this? I'm new to jars.
John de Michele
Rancher

Joined: Mar 09, 2009
Posts: 600
Paul:

Sorry, that won't work. You can set a main() method in a class that will run when the jar is executed. In order to do what you want, you'd need to a create a new .jar file for each of the methods.

John.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using a Jar File in Dos/Batch Script
 
Similar Threads
Properties packaging
Problem running code from EJB in action book (chapter1)
Converting MIDP suites to .PRC files
"Executables" Win2000 - a solution
problem in running jar file