[ale] Java Classpath quesiton

cfowler cfowler at outpostsentinel.com
Thu Feb 13 08:44:22 EST 2003



I'm trying to get an applicaiton in one jar file to call a class in
another.  But it complains about a class not being found.  The only fix
I have came up with was to merge the 2 jars into one.  Then everything
works.  I'm hoping someone can tell me what I'm doing wrong.

Here is my script:


#!/bin/sh

merge() {
        TMPDIR=~/cc.$$
        mkdir $TMPDIR
        cd $TMPDIR
        jar xvf ../target/ConsoleConnection.jar
        jar xvf ../target/CommandCenter.jar
        jar cvmf mainClass ../CC.jar .
        cd ..
        rm -rf $TMPDIR
        return

}

if [ "$1" == "merge" ]
then
        merge
        exit 0
fi

PROFILES=~/MachineProfiles.xml

CLASSPATH=$CLASSPATH:.:`pwd`/target/ConsoleConnection.jar
export CLASSPATH

echo "CLASSPATH: "${CLASSPATH}
echo "MACHINE PROFILES: "${PROFILES}

java -cp ${CLASSPATH} -jar ./CommandCenter.jar -f ${PROFILES}

Without merging, I get this when I tell the app to use
ConsoleConnection:

[cfowler at cfowler cfowler]$ ./cc.sh 
CLASSPATH:
.:/opt/tomcat/common/lib/servlet.jar:.:/home/cfowler/target/ConsoleConnection.jar
MACHINE PROFILES: /home/cfowler/MachineProfiles.xml
Warning: Cannot convert string "MetaCtrl<Key>Insert" to type
VirtualBinding
java.lang.NoClassDefFoundError:
com/outpost/consoleconnection/ConsoleConnection
        at
com.outpostsentinel.commandcenter.ui.panel.SystemStatusPanel$5.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:536)



Thanks,
Chris

_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale






More information about the Ale mailing list