One of the way to resolve Java ClassNotFound Exception in Java Compilation
This Shell Script explores the given set of Jar(s) present in a directory and search for given Class inside the Jar file.1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | echo "#########################################" echo "JarExplorer - The Java Jar file Explorer" echo "#########################################" echo " This utility searches Class inside a Jar File(s)" echo -n "Enter the Path/folder contains jar file(s) : " read jarPath [ -d $jarPath ] && { echo "Directory/Folder Exists" cd $jarPath > /dev/ null echo -n "Enter the Class Name to Search :" read classSearch ls *.jar | \ while read afile do echo -n "Looking in " $afile jar -tvf $afile > ClassList sed 's/\//\./g' ClassList > ClassListOut cat ClassListOut | grep -w $classSearch\. class | echo " : " $classSearch " Class exists !" done rm ClassList rm ClassListOut exit } echo "Invalid Directory" # Sample org.apache.commons.collections.Bag |