Click to See Complete Forum and Search --> : java


October 8th, 1999, 09:54 AM
I'm having problems trying to create a jar file programmatically, not from the dos prompt.
the problem is I don't know if that can be possible by using any of the classes in the
java.util.jar . Could anybody please help me

poochi
October 8th, 1999, 05:00 PM
Try like this , ( Not tested )



Runtime.getRuntime().exec( "d:/jdk/bin/jar -cvf myjar.jar 1.class,2.class" );





And there is an undocumented package in sun.tools package ( sun.tools.jar ) which
contains a class called Main. If you figure out how to use it , you can create your
jar file programmatically. But it's very hard. Search for this package in the net.

Poochi..