Find java build version of the class files in a jar file using ant? -
is there ant task allows me @ jar file , figure out java version class files in jar compiled for?
you're going have write one. existing tasks, it's going ugly - isn't ant shines at.
you unzip jar, , either exec out file (unix machines), see 1 version 51 (java 7)
$file myclass.class myclass.class; compiled java class data, version 51.0 or if you're using windows use javap -v
$javap -v myclass.class classfile myclass.class last modified sep 24, 2013; size 7317 bytes md5 checksum 73667731fe2ec6519b1c0c4676a96c70 public class com.foo.myclass minor version: 0 major version: 51 you'd have use use replaceregex or sauce find major version.
you're going better off writing small task, can use apache's byte code engineering library pull out version.
Comments
Post a Comment