Skip to content

Conversation

smatvienko-tb
Copy link
Contributor

@smatvienko-tb smatvienko-tb commented Sep 11, 2025

Pull Request description

Added java-17-devel to match non-openJDK Java distributions for RPM install.

An old AmazonLinux 2 LTS with old PRM 4.11 does not recognize multiple dependencies and should be installed with --nodeps

❌ AmazonLinux2 failed test

mvn clean install -DskipTests
docker run -it --rm --name rpmtest amazonlinux:2 bash
docker cp ./application/target/thingsboard.rpm rpmtest:/tmp/
# Successfully copied 349MB to rpmtest:/tmp/
yum install -y java-17-amazon-corretto-devel
java -version
# openjdk version "17.0.16" 2025-07-15 LTS
# OpenJDK Runtime Environment Corretto-17.0.16.8.1 (build 17.0.16+8-LTS)
# OpenJDK 64-Bit Server VM Corretto-17.0.16.8.1 (build 17.0.16+8-LTS, mixed mode, sharing)
rpm -Uvh /tmp/thingsboard.rpm
# error: Failed dependencies:
#         (java-17 or java-17-headless or jre-17 or jre-17-headless or java-17-devel) is needed by thingsboard-0:4.2.0~RC-1.noarch
rpm -q --provides java-17-amazon-corretto-devel.aarch64
# java-17-amazon-corretto-devel = 1:17.0.16+8-1.amzn2.1
# java-17-amazon-corretto-devel(aarch-64) = 1:17.0.16+8-1.amzn2.1
# java-17-devel = 1:17.0.16
# java-17-devel = 1:17.0.16+8-1.amzn2.1
# java-devel = 1:17.0.16
rpm --version
# RPM version 4.11.3

Run rpm --version → if it’s 4.11.x, then Amazon Linux 2 cannot handle rich dependencies. On AL2, either use --nodeps or rebuild the RPM without rich deps. On AL2023+, no issue.

Example for Amazon Corretto Java:

JDK

⚠️ The tag added java-17-devel

docker run --rm -it amazonlinux:2 bash -c "yum install -y java-17-amazon-corretto-devel && rpm -q --provides java-17-amazon-corretto-devel.aarch64"   

java-17-amazon-corretto-devel = 1:17.0.16+8-1.amzn2.1
java-17-amazon-corretto-devel(aarch-64) = 1:17.0.16+8-1.amzn2.1
java-17-devel = 1:17.0.16
java-17-devel = 1:17.0.16+8-1.amzn2.1
java-devel = 1:17.0.16

JRE

✅ The tag jre-17 already supported

docker run --rm -it amazonlinux:2 bash -c "yum install -y java-17-amazon-corretto && rpm -q --provides java-17-amazon-corretto.aarch64"

java = 1:17.0.16
java-17 = 1:17.0.16
java-17 = 1:17.0.16+8-1.amzn2.1
java-17-amazon-corretto = 1:17.0.16+8-1.amzn2.1
java-17-amazon-corretto(aarch-64) = 1:17.0.16+8-1.amzn2.1
jre = 17.0.16
jre-17 = 1:17.0.16+8-1.amzn2.1
jre-17-amazon-corretto = 1:17.0.16+8-1.amzn2.1

Headless

✅ The tag jre-17-headless already supported

docker run --rm -it amazonlinux:2  bash -c "yum install -y java-17-amazon-corretto-headless && rpm -q --provides java-17-amazon-corretto-headless.aarch64"

config(java-17-amazon-corretto-headless) = 1:17.0.16+8-1.amzn2.1
java-17-amazon-corretto-headless = 1:17.0.16+8-1.amzn2.1
java-17-amazon-corretto-headless(aarch-64) = 1:17.0.16+8-1.amzn2.1
java-17-headless = 1:17.0.16+8-1.amzn2.1
java-headless = 1:17.0.16
jre-17-amazon-corretto-headless = 1:17.0.16+8-1.amzn2.1
jre-17-headless = 1:17.0.16+8-1.amzn2.1
jre-headless = 1:17.0.16

Related PR to give more context: #13744

Manual test on AmazonLinux:2023

⚠️ Requires dnf install -y shadow-utils ⚠️
otherwise

/var/tmp/rpm-tmp.xxG9uG: line 9: groupadd: command not found
/var/tmp/rpm-tmp.xxG9uG: line 11: useradd: command not found

with JDK

mvn clean install -DskipTests
docker run -it --rm --name rpmtest amazonlinux:2023 bash
docker cp ./application/target/thingsboard.rpm rpmtest:/tmp/
# Successfully copied 349MB to rpmtest:/tmp/
yum install -y java-17-amazon-corretto-devel
java -version
# openjdk version "17.0.16" 2025-07-15 LTS
# OpenJDK Runtime Environment Corretto-17.0.16.8.1 (build 17.0.16+8-LTS)
# OpenJDK 64-Bit Server VM Corretto-17.0.16.8.1 (build 17.0.16+8-LTS, mixed mode, sharing)
dnf install -y shadow-utils
rpm -Uvh /tmp/thingsboard.rpm
# Verifying...                          ################################# [100%]
# Preparing...                          ################################# [100%]
# Updating / installing...
#    1:thingsboard-0:4.2.0~RC-1         ################################# [100%]

with JRE

docker run -it --rm --name rpmtest amazonlinux:2023 bash
docker cp ./application/target/thingsboard.rpm rpmtest:/tmp/

yum install -y java-17-amazon-corretto
java -version
# openjdk version "17.0.16" 2025-07-15 LTS
# OpenJDK Runtime Environment Corretto-17.0.16.8.1 (build 17.0.16+8-LTS)
# OpenJDK 64-Bit Server VM Corretto-17.0.16.8.1 (build 17.0.16+8-LTS, mixed mode, sharing)
dnf install -y shadow-utils
rpm -Uvh /tmp/thingsboard.rpm
# Verifying...                          ################################# [100%]
# Preparing...                          ################################# [100%]
# Updating / installing...
#    1:thingsboard-0:4.2.0~RC-1         ################################# [100%]

with headless

docker run -it --rm --name rpmtest amazonlinux:2023 bash
docker cp ./application/target/thingsboard.rpm rpmtest:/tmp/

yum install -y java-17-amazon-corretto-headless
java -version
# openjdk version "17.0.16" 2025-07-15 LTS
# OpenJDK Runtime Environment Corretto-17.0.16.8.1 (build 17.0.16+8-LTS)
# OpenJDK 64-Bit Server VM Corretto-17.0.16.8.1 (build 17.0.16+8-LTS, mixed mode, sharing)
dnf install -y shadow-utils
rpm -Uvh /tmp/thingsboard.rpm
# Verifying...                          ################################# [100%]
# Preparing...                          ################################# [100%]
# Updating / installing...
#    1:thingsboard-0:4.2.0~RC-1         ################################# [100%]

with no Java installed

docker run -it --rm --name rpmtest amazonlinux:2023 bash
docker cp ./application/target/thingsboard.rpm rpmtest:/tmp/

rpm -Uvh /tmp/thingsboard.rpm
# error: Failed dependencies:
#         (java-17 or java-17-headless or jre-17 or jre-17-headless or java-17-devel) is needed by thingsboard-0:4.2.0~RC-1.noarch
# bash-5.2# 

General checklist

  • You have reviewed the guidelines document.
  • Labels that classify your pull request have been added.
  • The milestone is specified and corresponds to fix version.
  • Description references specific issue.
  • Description contains human-readable scope of changes.
  • Description contains brief notes about what needs to be added to the documentation.
  • No merge conflicts, commented blocks of code, code formatting issues.
  • Changes are backward compatible or upgrade script is provided.
  • Similar PR is opened for PE version to simplify merge. Crosslinks between PRs added. Required for internal contributors only.

Front-End feature checklist

  • Screenshots with affected component(s) are added. The best option is to provide 2 screens: before and after changes;
  • If you change the widget or other API, ensure it is backward-compatible or upgrade script is present.
  • Ensure new API is documented here

Back-End feature checklist

  • Added corresponding unit and/or integration test(s). Provide written explanation in the PR description if you have failed to add tests.
  • If new dependency was added: the dependency tree is checked for conflicts.
  • If new service was added: the service is marked with corresponding @TbCoreComponent, @TbRuleEngineComponent, @TbTransportComponent, etc.
  • If new REST API was added: the RestClient.java was updated, issue for Python REST client is created.
  • If new yml property was added: make sure a description is added (above or near the property).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant