Checking if classpath files exist and are readable
Recently found an issue where all the files on the classpath existed, but one of the core classes was being selected from a JAR which it shouldn’t be. Some effort found that the execution user was unable to read the JAR (no read permissions).
The following script verified this:
IFS=:
for cp in $JAVA_HOME/jre/lib/*.jar $CLASSPATH
do
if [ -f $cp ]
then
echo “$cp found”
else
echo “$cp missing”
fi
done
Leave a Reply