If you have two jars in your classpath that contain different versions of the same class, the classpath order becomes critical.
I am looking for a tool that can detect and flag such potential conflicts in a given classpath or set of folders.
Certainly a script that starts:
classes=`mktemp`
for i in `find . -name "*.jar"`
do
echo "File: $i" > $classes
jar tf $i > $classes
...
done
with some clever sort/uniq/diff/grep/awk later on has potential, but I was wondering if anyone knows of any existing solutions.
Eclipse can do it, just create a (temporary) project and put your libraries on the projects classpath. Then you can easily find the classes. Another tool, that comes to my mind, is Java Decompiler. It can open a lot of jars at once and helps to find classes as well.
To find the . jar files that contain a class, you can use the FindClass.sh script. First go to a UNIX installation of Sterling Platform/MCF. If the FindClass.sh script already exists it should be in your $YFS_HOME directory or your $YFS_HOME/lib directory.
Looks like jarfish will do what you want with its "dupes" command.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With