Analyzer for bytecode versions of class files in a JAR file.
You can get the latest release from GitHub Releases, click here for the latest stable release.
Download the latest releases JAR file (via GitHub Releases), open a command line and run the JAR via java -jar, providing the necessary arguments.
If you don't provide any arguments, it will print the help text. Here is a screenshot of the help message from v0.1-SNAPSHOT:
Specifying a class name as an argument will look for a class file in the current directory and print the version of it. Specifying a full path of class files is also supported.
Specifying an archive (zip, jar) file name as an argument will also look for an archive file in the current directory, and will analyze all class files in it. Specifying a full path is also supported.
If you don't provide --print-if-above or --print-if-below arguments, it will only print messages such as X amount of classes use 52.0 (Java 8) for every different bytecode version. Here is an image if you provide both arguments:
You can find old libraries that compile with/into Java 6, or you can find for example libraries that compile into Java 11, or other versions.
-
Multi-Release JARs are supported. However, to fully support Multi-Release JARs, you must run the program from Java 10 or above. This because JarFile#versionedStream is added in Java 10.
However, you can still get partial support on Java 9. This because basic versioned JarFile support is added in Java 9. (The new JarFile constructor accepting Runtime.Version objects.)
-
Preview class files (classes compiled with --enable-preview) are also supported.
-
This not a tool to modify/update bytecode or class/jar files in any way.
- This tool will still take into account even if a class file is not used or loaded in run-time.
- Refactor code to make it more organized
- Add tests
- Use a logger to log messages/errors
Please see Security policy.
Please see Contributing documentation and Project preferences.