Prev: Menu in Swing
Next: [arguably OT] Keyboards
From: John B. Matthews on 22 Apr 2010 22:40 In article <alpine.DEB.1.10.1004222312580.7087(a)urchin.earth.li>, Tom Anderson <twic(a)urchin.earth.li> wrote: > > So a bit of bash shell scripting worked it out. > > > > $ cat findit > > #!/bin/bash > > > > jars=`find . -name "*.jar"` > > > > for i in $jars; do > > # echo JAR: $i > > jar -tf $i | grep ValidatorFactory > > if [ $? == 0 ] ; then > > Kids today! Nobody remembers that the original use of if was directly on > exit statuses: > > if jar -tf $i | grep ValidatorFactory > then > whatever > fi Now, with more parameters! #!/bin/sh if [ $# != 2 ]; then echo "Usage: `basename $0` path string" exit 1 fi jars=`find $1 -name \*.jar` for i in $jars; do if jar -tf $i | grep $2; then echo JAR: $i fi done -- John B. Matthews trashgod at gmail dot com <http://sites.google.com/site/drjohnbmatthews>
From: markspace on 23 Apr 2010 00:02 Tom Anderson wrote: > find $SOMEWHERE -name \*.jar -print0 | xargs -0 grep -l ValidatorFactory > | while read jarfile; do echo $jarfile $(jar tf $jarfile | grep > ValidatorFactory); done > Nice one! > > Kids today! Nobody remembers that the original use of if was directly on > exit statuses: Thanks for pointing that out. I admit I did that script while reading the bash scripting How-To. Overall I think it wasn't bad for five minutes of study and trial and error. I so seldom write shell scripts, nothing sticks in my brain.
From: vincentdeygas on 23 Apr 2010 03:33
Hy, I suggest you this site http://www.jarvana.com/jarvana/ You can use Jarvana site to search for classes and their associated jar files to resolve NoClassDefFoundError and ClassNotFoundException issues. Source code and javadocs can be viewed when available. Classes, artifacts, and content in the maven central repository are searchable. You can obtain dependency information for classes and artifacts, inspect POM files, and inspect plugins. Vince |