Get jar version in runtime

Try this, it may be helpful:

String s = new String();
System.out.println(s.getClass().getPackage().getSpecificationVersion());
System.out.println(s.getClass().getPackage().getImplementationVersion());

Output:

1.7
1.7.0_25

Leave a Comment