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.

The Dockerfile has been modified to remove any Java packages
pulled by the existing JSS package to ensure that the build
will be done using the correct Java version.
  • Loading branch information
edewata committed Mar 6, 2024
1 parent a977b5d commit ad92c99
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ RUN if [ -n "$COPR_REPO" ]; then dnf copr enable -y $COPR_REPO; fi

# Install JSS runtime dependencies
RUN dnf install -y dogtag-jss \
&& dnf remove -y dogtag-* --noautoremove \
&& rpm -e --nodeps $(rpm -qa | grep -E "^java-|^dogtag-") \
&& dnf clean all \
&& rm -rf /var/cache/dnf

Expand Down
18 changes: 18 additions & 0 deletions jss.spec
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,28 @@ ExcludeArch: i686
# 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+
%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 Options
################################################################################
Expand Down

0 comments on commit ad92c99

Please sign in to comment.