Jardiff, a tool for diffing the bytecode in JARs

jardiff isn’t new (Jason Zaugg first built it in 2017), but it hasn’t been publicized much either, and we just rolled a new release, so I thought I’d re-announce it here.

It’s a useful tool for compiler hackers. You can compile some code before and after your compiler change, and use jardiff to see, in full detail, what effect it had on the bytecode. (Or, you might want to simply verify that there wasn’t any effect.)

For information, downloads, and examples, visit: GitHub - lightbend-labs/jardiff: A tool for comparing JAR files, including method bodies and Scala 2 pickled signatures

The new 1.7.0 release supports recent JDK versions (through 20).

Here’s a little sample of its output:

@@ -8,7 +8,7 @@
     ALOAD 0
     INVOKESPECIAL java/lang/Object.<init> ()V
     ALOAD 0
-    INVOKESTATIC T$class.$init$ (LT;)V
+    INVOKESTATIC T.$init$ (LT;)V
     RETURN
     MAXSTACK = 1
     MAXLOCALS = 1
15 Likes