class-version.sh: avoid using javap

Just for you, Dscho!

Unfortunately, and surprisingly, performance is not much better:

export jar1=org/python/jython-standalone/2.7-b3/jython-standalone-2.7-b3.jar
export jar2=org/python/jython-standalone/2.5.3/jython-standalone-2.5.3.jar

== Using javap ==

$ time class-version.sh $jar1 $jar2
org/python/jython-standalone/2.7-b3/jython-standalone-2.7-b3.jar: J2SE 7 (51.0)
org/python/jython-standalone/2.5.3/jython-standalone-2.5.3.jar: J2SE 5.0 (49.0)

real    0m2.538s
user    0m4.616s
sys     0m0.810s

$ time class-version.sh $jar1 $jar2
org/python/jython-standalone/2.7-b3/jython-standalone-2.7-b3.jar: J2SE 7 (51.0)
org/python/jython-standalone/2.5.3/jython-standalone-2.5.3.jar: J2SE 5.0 (49.0)

real    0m2.382s
user    0m4.467s
sys     0m0.786s

== Using unzip ==

$ time class-version.sh $jar1 $jar2
org/python/jython-standalone/2.7-b3/jython-standalone-2.7-b3.jar: J2SE 7 (51.0)
org/python/jython-standalone/2.5.3/jython-standalone-2.5.3.jar: J2SE 5.0 (49.0)

real    0m3.026s
user    0m4.443s
sys     0m1.158s

$ time class-version.sh $jar1 $jar2
org/python/jython-standalone/2.7-b3/jython-standalone-2.7-b3.jar: J2SE 7 (51.0)
org/python/jython-standalone/2.5.3/jython-standalone-2.5.3.jar: J2SE 5.0 (49.0)

real    0m3.061s
user    0m4.486s
sys     0m1.161s

== Simplifying further ==

Even if you cut out the sed and expr commands like so:

  # extract byte #7
  major="$(unzip -p "$jar" "$(jar tf "$jar" | grep \.class$ | head -n 1)" | head -c 8 | hexdump -s 7 -e '1/1 "%d\n"')"

The results are no more impressive:

$ time class-version.sh $jar1 $jar2
org/python/jython-standalone/2.7-b3/jython-standalone-2.7-b3.jar: J2SE 7 (51)
org/python/jython-standalone/2.5.3/jython-standalone-2.5.3.jar: J2SE 5.0 (49)

real    0m3.053s
user    0m4.526s
sys     0m1.151s

$ time class-version.sh $jar1 $jar2
org/python/jython-standalone/2.7-b3/jython-standalone-2.7-b3.jar: J2SE 7 (51)
org/python/jython-standalone/2.5.3/jython-standalone-2.5.3.jar: J2SE 5.0 (49)

real    0m3.063s
user    0m4.656s
sys     0m1.151s