Friday, August 25, 2006

Run Java class in jar file

Specify a default class to run in jar file:
Code the class name and classpath in manifest.txt file (use space between classpath items):

Main-Class: CompileServlet
Class-path: /QIBM/ProdData/OS400/jt400/lib/jt400Native.jar /context/WEB-INF/lib/log4j-1.2.9.jar

Then merge this manifest file with the jar file:

C:\temp>jar muf manifest.txt mygenerator.jar


To run the class:

java -jar mygenerator.jar p1 p2

0 Comments:

Post a Comment

<< Home