Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find out Scala Version Used to Make JAR

Tags:

jar

scala

I'm trying to figure out which Scala version was used to compile A.jar. I have two versions: one from my ivy2 repo, and the other from Maven.

After running jar -xf A.jar, I grepped for scala and version, but found nothing:

$grep -ri scala *
$grep -ri version *

So, based on an unzipped* JAR, how can I determine which version of Scala was used to compile it?

*unzipped = run java xf <name of jar>

like image 771
Kevin Meredith Avatar asked Jan 22 '14 21:01

Kevin Meredith


1 Answers

The only convention I am aware of, is to put the version of scala in the name of the jar, for exemple : scala-stm_2.9.3.jar. But this is a convention ;-)

Now, if the name doesn't follow that convention, get any "class" file from the jar and run the javap command on if, cf: How can I tell what Scala version a .class file was compiled with?

like image 193
n1r3 Avatar answered Oct 19 '22 02:10

n1r3