srikanthradix
asked on
Executing a Jar File through Unix script
It is calling Main-Class in jar file but the classpath is not set weirdly. It is giving me some class not found from the libraries.
#!/bin/ksh
DIR=`dirname $0`
# Set new class path
echo "Setting classpath"
CLASSPATH=${DIR}/config
for i in `ls -1 lib/*.jar`; do
CLASSPATH=${CLASSPATH}:${DIR}/${i}
done
`java -jar -cp $CLASSPATH -Ddir=${DIR} zones.jar`
exit 0
Just make sure the classpath and DIR is what you want by echoing them before you execute java (for which you don't need backticks)
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Manifest thing did the trick. Thanks
:-)