Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get third party library versions in Java

Tags:

java

In Python, after importing libraries, you can easily get their version numbers. For example for json, you can easily get its version by using json.__version__. Is there a way in Java that can do the same thing?

like image 412
Gnijuohz Avatar asked Mar 17 '23 18:03

Gnijuohz


1 Answers

There is a standard, but it's not commonly used. You may well be able to pull version info out of the jar's MANIFEST.MF file, but that will be particular to a library/vendor etc. Hopefully if you're only interested in a few particular libraries, then you can accommodate whatever notation they've adopted.

like image 196
Brian Agnew Avatar answered Mar 30 '23 02:03

Brian Agnew