JAPI-COMPLIANCE-CHECKER(1)
π¦ JAPI-COMPLIANCE-CHECKER π¦
hiii bestie π you just cracked open the manual page for japi-compliance-checker, and yes it lives in the User Commands corner of the man-page universe (section 1, iykyk). it's a whole glow-up guard for your Java library, no cap. sit down, grab a strawberry drink π, and let's get into it.
πΈ NAME πΈ
japi-compliance-checker β check backward compatibility of a Java library API. that's it. that's the whole first impression. iconic.
β¨ DESCRIPTION β¨
π NAME:
Java API Compliance Checker (japi-compliance-checker) β Check backward compatibility of a Java library API
π DESCRIPTION:
Java API Compliance Checker (JAPICC) is a tool for checking backward binary/source compatibility of a Java library API. The tool checks class declarations of old and new versions and analyzes changes that may break compatibility: removed class members, added abstract methods, etc.
Break of the binary compatibility may result in crash or incorrect behavior of existing clients built with an old library version if they run with a new one. Break of the source compatibility may result in recompilation errors with a new library version.
The tool is intended for developers of software libraries and maintainers of operating systems who are interested in ensuring backward compatibility, i.e. allow old clients to run or to be recompiled with newer library versions.
This tool is free software: you can redistribute it and/or modify it under the terms of the GNU LGPL.
fr fr, this is a "don't break your users" tool and it takes that job very seriously π
π USAGE:
japi-compliance-checker [options]
π EXAMPLE (1):
japi-compliance-checker OLD.jar NEW.jar
π EXAMPLE (2):
japi-compliance-checker OLD.jmod NEW.jmod
π EXAMPLE (3):
japi-compliance-checker -lib NAME -old OLD.xml -new NEW.xml
OLD.xml and NEW.xml are XML-descriptors:
<version>
1.0
</version>
<archives>
/path1/to/JAR(s) OR JMOD(s)/ /path2/to/JAR(s) OR JMOD(s)/ ...
</archives>
π INFORMATION OPTIONS: π
-h|-helpβ print this help. the classic "what do I even do here" button π«Ά-v|-versionβ print version information.-dumpversionβ print the tool version (2.4) and don't do anything else. she says her age and then leaves. periodt.
π GENERAL OPTIONS: π
-l|-libraryNAME β library name (without version).-old|-d1PATH β descriptor of the 1st (old) library version. it may be one of the following:- Java archive (
*.jaror*.jmod) - XML-descriptor (
VERSION.xmlfile):
- Java archive (
<version>
1.0
</version>
<archives>
/path1/to/JAR(s) OR JMOD(s)/ /path2/to/JAR(s) OR JMOD(s)/
...
</archives>
...
- API dump generated by
-dumpoption
If you are using *.jar or *.jmod as a descriptor then you should specify version numbers with -v1 and -v2 options too. If version numbers are not specified then the tool will try to detect them automatically.
-new|-d2PATH β descriptor of the 2nd (new) library version.
π₯ EXTRA OPTIONS: π₯
-client|-appPATH β this option allows to specify the client Java archive that should be checked for portability to the new library version.-binary|-binβ show "Binary" compatibility problems only. Generate report tobin_compat_report.html.-source|-srcβ show "Source" compatibility problems only. Generate report tosrc_compat_report.html.-v1|-version1NUM β specify 1st API version outside the descriptor. This option is needed if you have prefered an alternative descriptor type (see-d1option).
In general case you should specify it in the XML descriptor:
<version>
VERSION
</version>
-v2|-version2NUM β specify 2nd library version outside the descriptor.-vnumNUM β specify the library version in the generated API dump.-s|-strictβ treat all API compatibility warnings as problems. no chill mode π€-keep-internalβ do not skip checking of these packages:*impl**internal**examples*
-skip-internal-packagesPATTERN β do not check packages matched by the regular expression.-skip-internal-typesPATTERN β do not check types (classes and interfaces) matched by the regular expression. It's matched against full qualified type names (e.g.'org.xyz.Name<T>'). It has to match any part of type name.-dump|-dump-apiPATH β dump library API to gzipped TXT format file. You can transfer it anywhere and pass instead of the descriptor. Also it may be used for debugging the tool.PATHis the path to the Java archive or XML descriptor of the library.-check-annotationsβ check for changes in annotations like in any other interfaces.-check-packagesPATTERN β check packages matched by the regular expression. Other packages will not be checked.-classes-listPATH β this option allows to specify a file with a list of classes that should be checked, other classes will not be checked.-annotations-listPATH β specifies a file with a list of annotations. The tool will check only classes annotated by the annotations from the list. Other classes will not be checked.-skip-annotations-listPATH β skip checking of classes annotated by the annotations in the list.-skip-deprecatedβ skip analysis of deprecated methods and classes. goodbye old yeller π-skip-classesPATH β list of classes that should not be checked.-skip-packagesPATH β list of packages that should not be checked.-non-implPATH β list of interfaces that should not be implemented by users.-non-impl-allβ all interfaces should not be implemented by users.-shortβ do not list added/removed methods.-dump-pathPATH β specify a*.dumpfile path where to generate an API dump. Default:
api_dumps/LIB_NAME/VERSION/API.dump
-report-pathPATH β path to compatibility report. Default:
compat_reports/LIB_NAME/V1_to_V2/compat_report.html
-bin-report-pathPATH β path to "Binary" compatibility report. Default:
compat_reports/LIB_NAME/V1_to_V2/bin_compat_report.html
-src-report-pathPATH β path to "Source" compatibility report. Default:
compat_reports/LIB_NAME/V1_to_V2/src_compat_report.html
-quickβ quick analysis. Disabled:- analysis of method parameter names
- analysis of class field values
- analysis of usage of added abstract methods
- distinction of deprecated methods and classes
-sortβ enable sorting of data in API dumps.-show-accessβ show access level of non-public methods listed in the report.-hide-templatesβ hide template parameters in the report.-hide-packagesβ no description given, she's keeping it mysterious π-minimalβ do nothing. literally the "not me, not today" option π-show-packagesβ show package names in the report.-limit-affectedLIMIT β the maximum number of affected methods listed under the description of the changed type in the report.-compactβ try to simplify formatting and reduce size of the report (for a big set of changes).-added-annotationsβ apply filters by annotations only to new version of the library.-removed-annotationsβ apply filters by annotations only to old version of the library.-count-methodsPATH β count total public methods in the API dump.-dep1PATH-dep2PATH β path to the API dump of the required dependency archive. It will be used to resolve overwritten methods and more.-old-styleβ generate old-style report.
π§ OTHER OPTIONS: π§
-testβ run internal tests. Create two incompatible versions of a sample library and run the tool to check them for compatibility. This option allows to check if the tool works correctly in the current environment.-debugβ debugging mode. Print debug info on the screen. Save intermediate analysis stages in the debug directory:
debug/LIB_NAME/VER/
Also consider using -dump option for debugging the tool.
-titleNAME β change library name in the report title toNAME. By default will be displayed a name specified by-loption.-jdk-pathPATH β path to the JDK install tree (e.g./usr/lib/jvm/java-7-openjdk-amd64).-external-cssPATH β generate CSS styles file toPATH. This helps to save space when generating thousands of reports.-external-jsPATH β generate JS script file toPATH.
π REPORT: π
compatibility report will be generated to:
compat_reports/LIB_NAME/V1_to_V2/compat_report.html
β EXIT CODES: β
0β Compatible. The tool has run without any errors.- non-zero β Incompatible or the tool has run with errors.
so like, 0 is the "we ate and left no crumbs" ending, and non-zero is the "we need to talk" ending π
π MORE INFO: π
π«Ά AUTHOR π«Ά
Written by Andrey Ponomarenko.
π COPYRIGHT π
Copyright Β© 2018 Andrey Ponomarenko's ABI Laboratory License: LGPLv2.1+ <http://www.gnu.org/licenses/> This program is free software: you can redistribute it and/or modify it.
okay bestie, that's the whole page π and now the cute little sign-off that lives at the very bottom, the one that's like the page's little name tag: it's the Java API Compliance Checker, dated November 2022, and yeah it's still the JAPI-COMPLIANCE-CHECKER(1) girlie you know and love ππ¦β¨
π¦ where this page comes from
- debian bookworm: japi-compliance-checker 2.4-3 Β· LGPL-2.1-or-later OR GPL-2.0-or-later
- debian trixie: japi-compliance-checker 2.4-3 Β· LGPL-2.1-or-later OR GPL-2.0-or-later
- ubuntu noble: japi-compliance-checker 2.4-3 Β· LGPL-2.1-or-later OR GPL-2.0-or-later
- ubuntu questing: japi-compliance-checker 2.4-3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms