So I have packed my classes and their dependancies (apache commons cli) inside a jar file using one-jar (which was easy enough to do, see section Command-Line Approach). Now I am curious if I can run the java test class inside the jar using a Junit jar outside the class. So the path to the test class inside sw.jar
is :
sw.jar\main\sw.jar\uoa\di\ys11\hw2\TestSmithWaterman.class
(the main\
is a one-jar thing). I have tried variations of :
java -jar -cp lib/junit.jar org.junit.runner.JUnitCore uoa.di.ys11.hw2.TestSmithWaterman
with no luck - so what would the command line be ? Or do I need to modify the one-jar manifest somehow ?
EDIT : the /boot-manifest.mf
:
Manifest-Version: 1.0
Main-Class: com.simontuffs.onejar.Boot
One-Jar-Main-Class: uoa.di.ys11.hw2.Hw2
while the /META-INF/MANIFEST.MF
:
Manifest-Version: 1.0
Created-By: 1.7.0_09 (Oracle Corporation)
Main-Class: com.simontuffs.onejar.Boot
One-Jar-Main-Class: uoa.di.ys11.hw2.Hw2