Skip to content

Commit

Permalink
Use Maven with OpenJDK 17 on RHEL 9
Browse files Browse the repository at this point in the history
  • Loading branch information
edewata committed Feb 14, 2025
1 parent e6dcb65 commit 4907684
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
3 changes: 1 addition & 2 deletions base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>17</source>
<target>17</target>
<release>17</release>
<compilerArgs>
<arg>-proc:none</arg>
<arg>-h</arg><arg>${project.build.directory}/include/_jni</arg>
Expand Down
11 changes: 8 additions & 3 deletions jss.spec
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,24 @@ ExcludeArch: i686
# Java
################################################################################

# use Java 17 on Fedora 39 or older and RHEL 9 or older
# otherwise, use Java 21

# maven-local is a subpackage of javapackages-tools

%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
%define maven_local maven-local-openjdk17

%else

# 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
%define maven_local maven-local

%endif

Expand Down Expand Up @@ -100,7 +105,7 @@ BuildRequires: nss-devel >= 3.97
BuildRequires: nss-tools >= 3.97

BuildRequires: %{java_devel}
BuildRequires: maven-local
BuildRequires: %{maven_local}
BuildRequires: mvn(org.apache.commons:commons-lang3)
BuildRequires: mvn(org.slf4j:slf4j-api)
BuildRequires: mvn(org.slf4j:slf4j-jdk14)
Expand Down

0 comments on commit 4907684

Please sign in to comment.