Skip to content

Commit

Permalink
Fix JAVA_HOME on Fedora 42
Browse files Browse the repository at this point in the history
  • Loading branch information
edewata committed Nov 5, 2024
1 parent fa9cd5e commit 3364569
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions ldapjdk.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
Name: ldapjdk
################################################################################

%global product_id dogtag-ldapjdk
%global vendor_id dogtag
%global product_id %{vendor_id}-ldapjdk

# Upstream version number:
%global major_version 5
Expand Down Expand Up @@ -53,25 +54,19 @@ ExclusiveArch: %{java_arches} noarch
# Java
################################################################################

%if 0%{?rhel} && 0%{?rhel} <= 9
%if 0%{?fedora} && 0%{?fedora} <= 39 || 0%{?rhel} && 0%{?rhel} <= 9

# use Java 17 on Fedora 39 or older and RHEL 9 or older
%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+ and RHEL 10, 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)
# otherwise, use Java 21
%define java_devel java-21-openjdk-devel
%define java_headless java-21-openjdk-headless
%define java_home %{_jvmdir}/jre-21-openjdk

%endif

Expand Down

0 comments on commit 3364569

Please sign in to comment.