CentOS 8 安装 Apache Commons Exec 指南

在 CentOS 8 搭建 Apache Commons Exec 1.6.0 环境:装 JDK 17 与 Maven,alternatives 与 JAVA_HOME 两坑,含两种获取方案、sha512 校验、验证程序与卸载。

Apache Commons ExecApache Commons Exec2026/10/14

CentOS 8 安装 Apache Commons Exec 指南

目标:在一台全新的 CentOS 8 服务器上搭建可编译、可运行 Apache Commons Exec 的 Java 环境,重点处理 CentOS 特有的 alternatives 默认 JDK 与 Maven 的 JAVA_HOME 问题,并覆盖发行包获取、校验、验证程序、多版本管理与卸载。全部命令与回显已在 CentOS 8(JDK 17 + Maven 3.5.4)实测通过。

Apache Commons Exec 是 Apache 基金会提供的 Java 库,用于在 JVM 内可靠地执行并管理外部进程:封装了进程启动、stdout/stderr 捕获、超时看门狗与异步回调,弥补了 JDK 自带 Runtime.exec / ProcessBuilder 在这几方面的欠缺。本文先给出环境与版本,再逐一实测两条获取 jar 的路线。

💡 技术拓展:在 JVM 里执行外部命令,业界有多种方案,选型前先看清各自边界。

方案所属特点适用场景
Runtime.exec()JDK 内置最简单,无超时、无流处理,易造成管道缓冲区死锁一次性简单调用
ProcessBuilderJDK 内置支持重定向与合并输出流,但超时/异步仍需自行实现可控的中等复杂度调用
JNA / JNI第三方 / 原生直接调用系统 API,能力最强但需平台库,部署重需操作系统级控制的场景
Apache Commons Exec独立库统一封装执行、流泵、超时看门狗、异步结果处理,零传递依赖需要超时控制与输出捕获的工程

本文实际采用 Apache Commons Exec 1.6.0,理由是它把「执行 + 超时 + 输出捕获 + 异步回调」一次性封装,且自身不引入任何运行期传递依赖,接入成本最低。

一、环境信息

本章确认系统版本,安装 JDK 17 与 Maven。Commons Exec 1.6.0 的字节码目标是 Java 8(jar 内清单 X-Compile-Source-JDK: 1.8、X-Compile-Target-JDK: 1.8),JDK 8 及以上均可运行;CentOS 8 自带 JDK 8 基础包,安装 JDK 17 后必须用 alternatives 把默认 java 切到 17,否则编译会回落到 1.8。

确认系统版本:

cat /etc/redhat-release

实测回显:

CentOS Linux release 8.4.2105

安装 JDK 17 开发包、Maven 与解压工具(约 2~3 分钟,取决于网络):

sudo dnf install -y java-17-openjdk-devel maven unzip

实测回显(输出节选,实测首尾):

Dependencies resolved.
Installing:
 java-17-openjdk-devel    x86_64  1:17.0.1.0.12-2.el8_5                  AppStream  5.1 M
 maven                    noarch  1:3.5.4-5.module_el8.0.0+39+6a9b6e22   AppStream   27 k
Installing dependencies:
 java-17-openjdk-headless x86_64  1:17.0.1.0.12-2.el8_5                  AppStream   41 M
  Installing : java-17-openjdk-headless-1:17.0.1.0.12-2.el8_5.x86_64  123/135
  Installing : java-17-openjdk-devel-1:17.0.1.0.12-2.el8_5.x86_64     134/135
Complete!

CentOS 8 的关键一步:查看并切换默认 java。先看当前 alternatives 登记:

alternatives --list | grep -E "^java |jre_17|java_sdk_17"

实测回显:

java_sdk_17             auto    /usr/lib/jvm/java-17-openjdk-17.0.1.0.12-2.el8_5.x86_64
jre_17_openjdk          auto    /usr/lib/jvm/jre-17-openjdk-17.0.1.0.12-2.el8_5.x86_64
java                    auto    /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.312.b07-2.el8_5.x86_64/jre/bin/java
java_sdk_17_openjdk     auto    /usr/lib/jvm/java-17-openjdk-17.0.1.0.12-2.el8_5.x86_64
jre_17                  auto    /usr/lib/jvm/java-17-openjdk-17.0.1.0.12-2.el8_5.x86_64

java 这一行指向 1.8 的路径,说明默认 JDK 仍是 1.8。显式切到 17 并验证:

sudo alternatives --set java java-17-openjdk.x86_64
sudo alternatives --set javac java-17-openjdk.x86_64
java -version
javac -version

实测回显:

openjdk version "17.0.1" 2021-10-19 LTS
OpenJDK Runtime Environment 21.9 (build 17.0.1+12-LTS)
OpenJDK 64-Bit Server VM 21.9 (build 17.0.1+12-LTS, mixed mode, sharing)
javac 17.0.1

Maven 还需要单独设置 JAVA_HOME(原因见第八章 FAQ Q2)。在当前会话临时生效:

export JAVA_HOME=/usr/lib/jvm/java-17-openjdk
export LANG=C.UTF-8
mvn -v

实测回显:

Apache Maven 3.5.4 (Red Hat 3.5.4-5)
Maven home: /usr/share/maven
Java version: 17.0.1, vendor: Red Hat, Inc., runtime: /usr/lib/jvm/java-17-openjdk-17.0.1.0.12-2.el8_5.x86_64
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "6.8.0-138-generic", arch: "amd64", family: "unix"

Java version: 17.0.1 确认 Maven 已使用 JDK 17。若要持久化,把 export JAVA_HOME=/usr/lib/jvm/java-17-openjdk 与 export LANG=C.UTF-8 两行追加到 /etc/profile.d/java17.sh 后重新登录即可。

二、版本选型

Commons Exec 遵循「最新稳定版挂在官方下载目录、历史版本进归档仓库」的发布策略,选型时建议直接使用最新稳定版。下表列出常用版本(JDK 要求以各版本 jar 清单与官方发布说明为准):

版本发布状态JDK 要求运行期传递依赖适用场景
1.6.0最新稳定版(2025)Java 8 及以上无(零传递依赖)新项目首选
1.5.0稳定版Java 8 及以上无1.6.0 有兼容顾虑时的回退
1.4.0稳定版Java 8 及以上无存量项目锁版本
1.3维护期版本Java 6 及以上无老系统兼容

关于「JDK 要求」的实测依据:解出 1.6.0 的 jar 清单,其中 X-Compile-Source-JDK: 1.8、X-Compile-Target-JDK: 1.8、Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))" 三处都表明 1.6.0 的字节码目标是 Java 8,因此 JDK 8/11/17/21 都能运行(本文用 JDK 17 实测)。

本文统一采用以下坐标与下载地址(均实测有效):

Maven 坐标:org.apache.commons:commons-exec:1.6.0
发行包:https://downloads.apache.org/commons/exec/binaries/commons-exec-1.6.0-bin.tar.gz
校验文件:https://downloads.apache.org/commons/exec/binaries/commons-exec-1.6.0-bin.tar.gz.sha512
中央仓库 jar:https://repo1.maven.org/maven2/org/apache/commons/commons-exec/1.6.0/commons-exec-1.6.0.jar
sha512(实测):
60dc9f43743b470ebcc5293773f0b166d2213f151180018a545fdc4076f7e8f38fa8c094ea56f4846bf10636d57a520f274f693a38d8ff7adcfe77b584c22e91

两点实测结论需要提前知道:

  1. downloads.apache.org 只保留最新版。实测访问旧版地址 https://downloads.apache.org/commons/exec/binaries/commons-exec-1.4.0-bin.tar.gz 返回 404,旧版需到 https://archive.apache.org/dist/commons/exec/binaries/ 下载(实测返回 200)。
  2. Commons Exec 是零运行期传递依赖的库。1.6.0 的 pom 中 <dependencies> 只有 JUnit 等 test 作用域条目,手动安装时只需要一个主 jar。

三、方案A:Maven 中央仓库依赖

方案A通过 Maven 自动解析并下载 jar。创建项目骨架:

mkdir -p /opt/exec-demo/src/main/java/net/quzuo/demo
cd /opt/exec-demo

该命令无输出。写入 pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>net.quzuo.demo</groupId>
  <artifactId>exec-demo</artifactId>
  <version>1.0.0</version>
  <packaging>jar</packaging>

  <properties>
    <maven.compiler.source>17</maven.compiler.source>
    <maven.compiler.target>17</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-exec</artifactId>
      <version>1.6.0</version>
    </dependency>
  </dependencies>
</project>

逐项说明:maven.compiler.source/target 按 Java 17 语法编译;project.build.sourceEncoding 强制源码 UTF-8(否则中文字符串会报 unmappable character);dependencies 只声明 commons-exec,因为它没有运行期传递依赖。

验证依赖解析结果:

export JAVA_HOME=/usr/lib/jvm/java-17-openjdk
mvn dependency:tree

实测回显(输出节选,实测首尾):

[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ exec-demo ---
[INFO] net.quzuo.demo:exec-demo:jar:1.0.0
[INFO] \- org.apache.commons:commons-exec:jar:1.6.0:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS

依赖树中只有 commons-exec 一行,直观证明零传递依赖。写入验证程序 src/main/java/net/quzuo/demo/HelloExec.java:

package net.quzuo.demo;

import org.apache.commons.exec.CommandLine;
import org.apache.commons.exec.DefaultExecutor;
import org.apache.commons.exec.PumpStreamHandler;

import java.io.ByteArrayOutputStream;
import java.nio.charset.StandardCharsets;

public class HelloExec {

    public static void main(String[] args) throws Exception {
        run("ls -l /opt/commons");
        run("echo hello commons exec");
        Package pkg = CommandLine.class.getPackage();
        System.out.println("commons-exec 版本: " + pkg.getImplementationVersion());
        System.out.println("验证通过");
    }

    private static void run(String command) throws Exception {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        ByteArrayOutputStream err = new ByteArrayOutputStream();
        DefaultExecutor executor = DefaultExecutor.builder()
                .setExecuteStreamHandler(new PumpStreamHandler(out, err))
                .get();
        int exitValue = executor.execute(CommandLine.parse(command));
        System.out.println("命令: " + command);
        System.out.println("退出码: " + exitValue);
        System.out.print(out.toString(StandardCharsets.UTF_8));
    }
}

程序逻辑:用 CommandLine.parse 把命令字符串拆成可执行文件与参数;用 DefaultExecutor.builder() 构造执行器并注入 PumpStreamHandler 捕获 stdout/stderr;execute 为同步调用,返回子进程退出码;最后从 jar 清单打印库版本。注意 1.6.0 中直接 new DefaultExecutor() 已标记为弃用,本文统一使用 builder 形态。

编译并生成运行类路径,然后运行:

export JAVA_HOME=/usr/lib/jvm/java-17-openjdk
mvn -q compile
mvn -q dependency:build-classpath -Dmdep.outputFile=/tmp/cp.txt
cat /tmp/cp.txt
java -Dfile.encoding=UTF-8 -cp "target/classes:$(cat /tmp/cp.txt)" net.quzuo.demo.HelloExec

实测回显:

/root/.m2/repository/org/apache/commons/commons-exec/1.6.0/commons-exec-1.6.0.jar
命令: ls -l /opt/commons
退出码: 0
total 880
-rw-r--r-- 1 root root 893502 Oct 13 16:25 commons-exec-1.6.0-bin.tar.gz
-rw-r--r-- 1 root root    129 Oct 13 16:25 commons-exec-1.6.0-bin.tar.gz.sha512
命令: echo hello commons exec
退出码: 0
hello commons exec
commons-exec 版本: 1.6.0
验证通过

程序成功驱动 ls -l 与 echo 两个外部命令并捕获其标准输出,方案A安装完成。Java version 若在此期间回落到 1.8,请确认 JAVA_HOME 已导出。

四、方案B:官方发行包手动安装

方案B适合没有 Maven 的机器:直接把官方发行包放到本地目录,用 java -cp 运行。下载发行包与校验文件:

sudo mkdir -p /opt/commons
cd /opt/commons
sudo curl -fsSLO https://downloads.apache.org/commons/exec/binaries/commons-exec-1.6.0-bin.tar.gz
sudo curl -fsSLO https://downloads.apache.org/commons/exec/binaries/commons-exec-1.6.0-bin.tar.gz.sha512
ls -l

实测回显:

total 880
-rw-r--r-- 1 root root 893502 Oct 13 16:25 commons-exec-1.6.0-bin.tar.gz
-rw-r--r-- 1 root root    129 Oct 13 16:25 commons-exec-1.6.0-bin.tar.gz.sha512

.sha512 文件内容是裸哈希,校验时拼成 哈希 文件名 的标准格式交给 sha512sum -c:

printf '%s  %s\n' "$(cat commons-exec-1.6.0-bin.tar.gz.sha512)" commons-exec-1.6.0-bin.tar.gz | sha512sum -c -

实测回显:

commons-exec-1.6.0-bin.tar.gz: OK

OK 表示下载件与官方发布的 sha512 完全一致。解压并查看发行包结构:

sudo tar xzf commons-exec-1.6.0-bin.tar.gz
ls -l commons-exec-1.6.0/*.jar

实测回显:

-rw-r--r-- 1 root root 444682 Nov 25  2025 commons-exec-1.6.0/commons-exec-1.6.0-javadoc.jar
-rw-r--r-- 1 root root  69399 Nov 25  2025 commons-exec-1.6.0/commons-exec-1.6.0-sources.jar
-rw-r--r-- 1 root root  57061 Nov 25  2025 commons-exec-1.6.0/commons-exec-1.6.0-test-sources.jar
-rw-r--r-- 1 root root  71154 Nov 25  2025 commons-exec-1.6.0/commons-exec-1.6.0-tests.jar
-rw-r--r-- 1 root root  69316 Nov 25  2025 commons-exec-1.6.0/commons-exec-1.6.0.jar

发行包内没有 lib/ 目录,因为 Commons Exec 零传递依赖,运行期只需要 commons-exec-1.6.0.jar 这一个文件。先实测一个必踩的坑——该 jar 清单里没有 Main-Class,java -jar 无法直接启动:

cd /opt/commons
java -jar commons-exec-1.6.0/commons-exec-1.6.0.jar
echo "退出码: $?"

实测回显:

no main manifest attribute, in commons-exec-1.6.0/commons-exec-1.6.0.jar
退出码: 1

正确做法是用 -cp 指定主 jar。把第三章的验证程序复制到 /opt/commons/(去掉 package 行)后编译运行:

cd /opt/commons
export LANG=C.UTF-8
javac -encoding UTF-8 -cp commons-exec-1.6.0/commons-exec-1.6.0.jar HelloExec.java
java -Dfile.encoding=UTF-8 -cp ".:commons-exec-1.6.0/commons-exec-1.6.0.jar" HelloExec

实测回显:

命令: ls -l /opt/commons
退出码: 0
total 892
-rw-r--r-- 1 root root   2350 Oct 13 16:34 HelloExec.class
-rw-r--r-- 1 root root   1177 Oct 13 16:34 HelloExec.java
drwxr-xr-x 3 root root   4096 Oct 13 16:34 commons-exec-1.6.0
-rw-r--r-- 1 root root 893502 Oct 13 16:25 commons-exec-1.6.0-bin.tar.gz
-rw-r--r-- 1 root root    129 Oct 13 16:25 commons-exec-1.6.0-bin.tar.gz.sha512
命令: echo hello commons exec
退出码: 0
hello commons exec
commons-exec 版本: 1.6.0
验证通过

注意 Linux 类路径分隔符是冒号 :(Windows 是分号)。方案B安装完成。

五、方案对比与选型建议

对比项方案A:Maven 依赖方案B:发行包手动安装
依赖管理自动解析,改版本只需改一处手动下载,需自行维护 jar 文件
升级成本改一行版本号重新构建重新下载、校验、替换 jar
离线部署需内网私服或预先缓存到本地仓库天然离线友好
可复现性pom 锁版本,强依赖脚本与人为记录
适用场景一切有构建工具的工程无 Maven 的跳板机、快速验证、交付现场

选型建议:开发 / CI 环境一律方案A;目标机器没有 Maven 或需要临时排查时用方案B。CentOS 8 特有的一点是方案A还依赖 JAVA_HOME 设置正确(CentOS 的 Maven 读 JAVA_HOME 而非 alternatives 的 java),方案B只依赖 alternatives 里 java 命令指向 17。

六、多版本管理

用「版本目录 + current 符号链接」方式管理多版本:所有版本平铺在 /opt/commons/ 下,每个版本目录内放一个 lib/,current 指向当前生效版本。本次实测同时部署 1.6.0(发行包解压得到)与 1.4.0(从中央仓库下载):

cd /opt/commons
sudo mkdir -p commons-exec-1.6.0/lib commons-exec-1.4.0/lib
sudo cp commons-exec-1.6.0/commons-exec-1.6.0.jar commons-exec-1.6.0/lib/
sudo curl -fsSL -o commons-exec-1.4.0/lib/commons-exec-1.4.0.jar https://repo1.maven.org/maven2/org/apache/commons/commons-exec/1.4.0/commons-exec-1.4.0.jar
sudo ln -sfn commons-exec-1.6.0 current
ls -l

实测回显:

total 896
-rw-r--r-- 1 root root   2350 Oct 13 16:34 HelloExec.class
-rw-r--r-- 1 root root   1177 Oct 13 16:34 HelloExec.java
drwxr-xr-x 3 root root   4096 Oct 13 16:39 commons-exec-1.4.0
drwxr-xr-x 4 root root   4096 Oct 13 16:39 commons-exec-1.6.0
-rw-r--r-- 1 root root 893502 Oct 13 16:25 commons-exec-1.6.0-bin.tar.gz
-rw-r--r-- 1 root root    129 Oct 13 16:25 commons-exec-1.6.0-bin.tar.gz.sha512
lrwxrwxrwx 1 root root     18 Oct 13 16:39 current -> commons-exec-1.6.0

current 指向 1.6.0。用 current 链接编译运行验证程序(复用第四章的 HelloExec.java):

cd /opt/commons
export LANG=C.UTF-8
javac -encoding UTF-8 -cp "current/lib/*" HelloExec.java -d out
java -Dfile.encoding=UTF-8 -cp "out:current/lib/*" HelloExec

实测回显(输出节选,实测首尾):

命令: ls -l /opt/commons
退出码: 0
total 900
drwxr-xr-x 3 root root   4096 Oct 13 16:39 commons-exec-1.4.0
drwxr-xr-x 4 root root   4096 Oct 13 16:39 commons-exec-1.6.0
lrwxrwxrwx 1 root root     18 Oct 13 16:39 current -> commons-exec-1.6.0
命令: echo hello commons exec
退出码: 0
hello commons exec
commons-exec 版本: 1.6.0
验证通过

切换到 1.4.0 再运行:

sudo ln -sfn commons-exec-1.4.0 current
java -Dfile.encoding=UTF-8 -cp "out:current/lib/*" HelloExec

实测回显(输出节选,实测首尾):

命令: ls -l /opt/commons
退出码: 0
lrwxrwxrwx 1 root root     18 Oct 13 16:39 current -> commons-exec-1.4.0
命令: echo hello commons exec
退出码: 0
hello commons exec
commons-exec 版本: 1.4.0
验证通过

程序打印的版本号随符号链接同步变为 1.4.0,证明切换生效。切回最新版:

sudo ln -sfn commons-exec-1.6.0 current

该命令无输出。关键约束:编译和运行都必须引用 current 路径,任何一处写死版本号目录,切换都会失效。

七、卸载

卸载分三部分:手动安装目录、Maven 本地仓库缓存、dnf 安装的软件包。清理手动目录与缓存:

sudo rm -rf /opt/commons
rm -rf ~/.m2/repository/org/apache/commons/commons-exec

该命令无输出。卸载前若之前用 alternatives --set 改过默认 java,可先恢复自动模式:

sudo alternatives --auto java
java -version

执行卸载并验证:

sudo dnf remove -y java-17-openjdk-devel maven
java -version
javac -version
mvn -v

实测回显(输出节选,实测首尾):

Removing unused dependencies:
  Erasing : maven-1:3.5.4-5.module_el8.0.0+39+6a9b6e22.noarch   1/135
  Erasing : maven-lib-1:3.5.4-5.module_el8.0.0+39+6a9b6e22.no   2/135
(中间若干部件未列出)
Complete!
bash: java: command not found
bash: javac: command not found
bash: mvn: command not found

注意实测发现 dnf remove java-17-openjdk-devel maven 会把 java-1.8.0-openjdk 一并移除(它是 maven 安装时引入的依赖),dnf history info last 可以核实:

dnf history info last | grep -E "Removed java|Removed maven"

实测回显(输出节选,实测首尾):

    Removed java-1.8.0-openjdk-1:1.8.0.312.b07-2.el8_5.x86_64                                 @@System
    Removed java-1.8.0-openjdk-devel-1:1.8.0.312.b07-2.el8_5.x86_64                           @@System
    Removed java-1.8.0-openjdk-headless-1:1.8.0.312.b07-2.el8_5.x86_64                        @@System
    Removed java-17-openjdk-1:17.0.1.0.12-2.el8_5.x86_64                                      @@System
    Removed java-17-openjdk-devel-1:17.0.1.0.12-2.el8_5.x86_64                                @@System
    Removed maven-1:3.5.4-5.module_el8.0.0+39+6a9b6e22.noarch                                 @@System

若机器上还需要 JDK 8 跑其他业务,卸载前要意识到这个连带影响,必要时在卸载后执行 sudo dnf install -y java-1.8.0-openjdk 补回。

八、FAQ

Q1:安装完 java-17-openjdk-devel 后 java -version 仍显示 1.8 怎么办? CentOS 8 的 alternatives 默认指向系统中已存在的 1.8。用 sudo alternatives --set java java-17-openjdk.x86_64 与 sudo alternatives --set javac java-17-openjdk.x86_64 显式切换,再用 java -version、javac -version 验证(见第一章实测回显,输出为 17.0.1)。

Q2:alternatives --set java 之后 mvn 编译还是报 invalid target release: 17 为什么? 因为 CentOS 8 的 Maven 读取的是 JAVA_HOME 而不是 alternatives 的 java 命令。解决:export JAVA_HOME=/usr/lib/jvm/java-17-openjdk(写入 /etc/profile.d/java17.sh 持久化),再用 mvn -v 核对 Java version 行,实测会显示 Java version: 17.0.1。

Q3:java -jar commons-exec-1.6.0.jar 为什么起不来? 实测回显为 no main manifest attribute,Commons Exec 是库而非可执行程序,jar 清单里没有 Main-Class。应使用 java -cp "主jar:应用类" 主类 方式运行,见第四章实测。

Q4:需要旧版本,但 downloads.apache.org 找不到? 官方主下载目录只保留最新版,实测旧版地址返回 404。历史版本在 https://archive.apache.org/dist/commons/exec/binaries/(实测返回 200),或直接从 Maven 中央仓库按版本号取 jar。

Q5:卸载 java-17-openjdk-devel 后系统里 JDK 8 也没了? 实测 dnf remove java-17-openjdk-devel maven 会连带移除 java-1.8.0-openjdk 系列(见第七章 dnf history 回显)。若仍需 JDK 8,卸载后执行 sudo dnf install -y java-1.8.0-openjdk 补回。

九、参考链接

  1. Apache Commons Exec 官方主页:https://commons.apache.org/proper/commons-exec/
  2. 1.6.0 发行包下载:https://downloads.apache.org/commons/exec/binaries/commons-exec-1.6.0-bin.tar.gz
  3. 发行包 sha512 校验文件:https://downloads.apache.org/commons/exec/binaries/commons-exec-1.6.0-bin.tar.gz.sha512
  4. Maven 中央仓库 1.6.0 目录:https://repo1.maven.org/maven2/org/apache/commons/commons-exec/1.6.0/
  5. Apache 归档下载站(历史版本):https://archive.apache.org/dist/commons/exec/binaries/
  6. 官方 javadoc(1.6.0 在线 API 文档):https://commons.apache.org/proper/commons-exec/apidocs/
  7. CentOS 8 java-17-openjdk-devel 包信息:https://pkgs.org/download/java-17-openjdk-devel
  8. Maven 安装文档:https://maven.apache.org/install.html