[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Next question for help in Java packaging: beast-mcmc



Hi,

On 12/03/11 12:13, Giovanni Mascellani wrote:
Third try: if I explicitly set classpath with this line

java -cp
/usr/share/beast-mcmc/lib/beast.jar:/usr/share/java/jam.jar:/usr/share/java/jdom1.jar:/usr/share/java/jebl.jar:/usr/share/java/commons-math.jar
dr.app.beast.BeastMain

then the program starts, accept the Flu.xml file and starts thinking,
writing some funny numbers on the screen (which I assume is a method to
say me "Hay man, things are wonderful here and I'm working happily").

The command line:

java -cp
/usr/share/java/jam.jar:/usr/share/java/jdom1.jar:/usr/share/java/jebl.jar:/usr/share/java/commons-math.jar
-jar /usr/share/beast-mcmc/lib/beast.jar

(which in my opinion should be equivalent to the previous, but clearly
is not) doesn't work. The program still fails finding the same class
from jebl. Probably the mechanism the virtual machine uses to search
classes when invoked with the "-jar" option isn't totally clear to me
(nevertheless, I'm sure that the Class-Path field in the manifest has
some meaning, because if I take it out from some JAR that actually works
with -jar, it doesn't work anymore).

The reality is that, invoked with -jar, java ignores any classpath from the command line and uses only the one from the manifest, which explains the differences in behavior your are experiencing.

Works as designed ;-)

Eric


Reply to: