Skip to content

Commit

Permalink
Update Java dependencies
Browse files Browse the repository at this point in the history
The RPM spec has been updated to use Java 21 on Fedora 40 or later
and Java 17 on other platforms.
  • Loading branch information
edewata committed Mar 28, 2024
1 parent 8439bc9 commit 974214d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ RUN if [ -n "$COPR_REPO" ]; then dnf copr enable -y $COPR_REPO; fi

# Install IDM Console Framework runtime dependencies
RUN dnf install -y java-17-openjdk-headless \
&& rpm -e --nodeps $(rpm -qa | grep -E "^java-") \
&& dnf clean all \
&& rm -rf /var/cache/dnf

Expand Down
18 changes: 18 additions & 0 deletions idm-console-framework.spec
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,28 @@ ExclusiveArch: %{java_arches} noarch
# Java
################################################################################

%if 0%{?rhel}

%define java_devel java-17-openjdk-devel
%define java_headless java-17-openjdk-headless
%define java_home %{_jvmdir}/jre-17-openjdk

%else

# Use Java 21 on Fedora 40+, otherwise use Java 17.
%global java_devel java-devel >= 1:17
%global java_headless java-headless >= 1:17

# Don't use find since it might not work well with local builds.
# find {_jvmdir} -maxdepth 1 | grep "jre-[0-9]\+$"
%global java_home %(
source /usr/share/java-utils/java-functions;
_prefer_jre=true;
set_jvm;
echo $JAVA_HOME)

%endif

################################################################################
# Build Dependencies
################################################################################
Expand Down

0 comments on commit 974214d

Please sign in to comment.