
extcheck Command in Linux
extcheck is a Linux command that is used to check for conflicts in JAR files, specifically looking at their titles and versions. This command is pretty useful in case you want to ensure that a new extension youre installing doesnt conflict with the preexisting ones in the Java SE SDK.
The extcheck command compares the Specification-title and Specification-version headers in the JAR files manifest against those in the installed extensions. If no conflicts are there, the command returns a zero exit code, however, a non-zero error code is returned if it finds a conflict.
Table of Contents
Here is a comprehensive guide to the options available with the extcheck command in linux −
- How to Install extcheck Command in Linux?
- Syntax of extcheck Command
- extcheck Command Options
- Examples of extcheck Command in Linux
How to Install extcheck Command in Linux?
The extcheck command is not preinstalled on Linux systems. It requires a Java package OpenJDK that you need to install on your system from the default package manager.
For Debian-based distributions like Ubuntu, you can use −
sudo apt install openjdk-8-jdk-headless
For RPM-based distributions like CentOS and Fedora, you can use −
sudo yum install java-1.8.0-openjdk-devel
For Arch Linux, you can run −
sudo pacman -S jdk8-openjdk
For OpenSUSE, simply use −
sudo zypper install java-1_8_0-openjdk-devel
These commands will install OpenJDK 8, which includes the extcheck utility. If you need a different version of OpenJDK, you can adjust the package name accordingly.
Syntax of extcheck Command
The basic syntax to use the extcheck command in Linux is provided below −
extcheck [options] targetfile.jar
Where,
- extcheck is the command used to invoke the utility.
- [options] are optional flags that are used for modifying the extcheck commands behavior.
extcheck Command Options
The extcheck command has a few options that can be used to customize its behavior; you can find their description in the below-given table −
Option | Description |
---|---|
-verbose | Displays JAR files in the extension directory during the check process. Additionally, it reports the manifest attributes of the target JAR file and identifies any conflicting JAR files. |
-Joption | Passes options to the Java Virtual Machine (JVM). |
Examples of extcheck Command in Linux
Lets discuss a few examples of extcheck commands in Linux systems. This will help you in learning how to get started with the command.
- Basic Usage
- Verbose Output
- Passing JVM Options
Basic Usage
The basic use of extcheck is to use it without an argument followed by the JAR file name. For example −
extcheck targetfile.jar
The above command will check the specified targetfile.jar for version conflicts with any extensions installed in the JDK software. Make sure to replace targetfile.jar with your desired JAR file.

Verbose Output
You can also get detailed information by using the extcheck command with the -verbose option. For example −
extcheck -verbose targetfile.jar
Once you execute the above command, it will list JAR files in the extension directory as they are checked and report any conflicts.

Passing JVM Options
You can also pass options to the Java Virtual Machine (JVM) using the -J option with the extcheck command. For example, to set the startup memory to 48 MB, you can use −
extcheck -J-Xms48m targetfile.jar
The above command will pass the -Xms48m option to the Java Virtual Machine (JVM). After that, it set the startup memory to 48 MB while checking the targetfile.jar for conflicts.

Thats how you can use the extcheck command in your Linux system.
Conclusion
The extcheck command is a powerful utility that helps you ensure compatibility and avoid any conflicts between JAR files in your Java environment. By checking the Specification-Title and Specification-Version headers in the manifest files, this command effectively maintains a stable and conflict-free Java SE SDK.
In this tutorial, we have covered the basics of extcheck command, starting from its installation down to simple examples on Linux. So whether you are installing new extensions or managing existing ones, you can use the extcheck command to avoid potential issues and ensure smooth operation.