How to use jarjar from the command line?

I'm having trouble using jarjar from the command line to combine a simple Scala program with a Scala time library.

jarjar correctly defines the dependency:

$ java -jar ~/Desktop/saug/jarjar-1.0.jar find jar BCT.jar scala-library.jar
/home/schani/Work/scala/bct/BCT.jar -> /home/schani/Work/scala/bct/scala-library.jar

Their combination does not work, however:

$ CLASSPATH=./scala-library.jar java -jar ~/Desktop/saug/jarjar-1.0.jar process rules.jjl BCT.jar BCTS.jar

The jar file I get depends on scala -library.jar. Regardless of whether I add the CLASSPATH variable, it does not matter. The rules.jjl file is as follows:

keep BCT

What to do?

+5
source share
3 answers

Using the java "-jar" option ignores the classpath. Try to explicitly specify the main class using the class path and omit the "-jar":

java -cp ~/Desktop/saug/jarjar-1.0.jar:./scala-library.jar com.tonicsystems.jarjar.Main process rules.jjl BCT.jar BCTS.jar
+1
source

scala.runtime.Nothing $class. (autojar; http://autojar.sourceforge.net/en_d/index.html) scala.

0

jarjar . .

, ? Ant , jarjar, .

0

All Articles