This is an automated email from the ASF dual-hosted git repository.
jbonofre pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-java.git
The following commit(s) were added to refs/heads/main by this push:
new 01affd741 GH-1078: Upgrade minimum JDK version from 11 to 17 (#1079)
01affd741 is described below
commit 01affd741864c493cb76b9357fb32ead7f977672
Author: JB Onofré <[email protected]>
AuthorDate: Tue Mar 24 07:49:08 2026 +0100
GH-1078: Upgrade minimum JDK version from 11 to 17 (#1079)
Update compiler source/target/release to 17 across build config
(pom.xml, bom), CI workflows, Docker images, Brewfile, and
documentation. Replace deprecated boxed-type constructors with valueOf()
in HolderReaderImpl codegen template to fix -Werror under release=17.
## What's Changed
JDK 11 would not be supported in some cases.
**This contains breaking changes.** <!-- Remove this line if there are
no breaking changes. -->
Closes #1078.
---
.env | 2 +-
.github/workflows/rc.yml | 4 ++--
.github/workflows/test.yml | 8 ++++----
Brewfile | 2 +-
bom/pom.xml | 8 ++++----
ci/docker/conda-jni.dockerfile | 2 +-
ci/docker/vcpkg-jni.dockerfile | 2 +-
compose.yaml | 4 ++--
docs/source/cdata.rst | 8 ++++----
docs/source/developers/building.rst | 16 ++++++++--------
docs/source/flight_sql_jdbc_driver.rst | 2 +-
docs/source/install.rst | 4 ++--
docs/source/jdbc.rst | 2 +-
docs/source/memory.rst | 2 +-
pom.xml | 10 +++++-----
vector/src/main/codegen/templates/HolderReaderImpl.java | 4 ++--
16 files changed, 40 insertions(+), 40 deletions(-)
diff --git a/.env b/.env
index a7783537d..2bd725547 100644
--- a/.env
+++ b/.env
@@ -47,7 +47,7 @@ ARROW_REPO=ghcr.io/apache/arrow-dev
ULIMIT_CORE=-1
# Default versions for various dependencies
-JDK=11
+JDK=17
MAVEN=3.9.9
# Versions for various dependencies used to build artifacts
diff --git a/.github/workflows/rc.yml b/.github/workflows/rc.yml
index 4973b1afb..9c75b8c80 100644
--- a/.github/workflows/rc.yml
+++ b/.github/workflows/rc.yml
@@ -273,7 +273,7 @@ jobs:
run: |
set -e
# make brew Java available to CMake
- export JAVA_HOME=$(brew --prefix
openjdk@11)/libexec/openjdk.jdk/Contents/Home
+ export JAVA_HOME=$(brew --prefix
openjdk@17)/libexec/openjdk.jdk/Contents/Home
ci/scripts/jni_macos_build.sh . arrow build jni
- name: Compress into single artifact to keep directory structure
run: tar -cvzf jni-macos-${{ matrix.platform.arch }}.tar.gz jni/
@@ -317,7 +317,7 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v5
with:
- java-version: '11'
+ java-version: '17'
distribution: 'temurin'
- name: Download Timezone Database
shell: bash
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 260259279..8c437a056 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -45,7 +45,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- jdk: [11, 17, 21, 23]
+ jdk: [17, 21, 23]
maven: [3.9.9]
image: [ubuntu, conda-jni-cdata]
include:
@@ -88,10 +88,10 @@ jobs:
matrix:
include:
- arch: AMD64
- jdk: 11
+ jdk: 17
macos: 15-intel
- arch: AArch64
- jdk: 11
+ jdk: 17
macos: latest
steps:
- name: Set up Java
@@ -123,7 +123,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- jdk: [11]
+ jdk: [17]
steps:
- name: Set up Java
uses: actions/setup-java@v5
diff --git a/Brewfile b/Brewfile
index af6bd6561..2c47a38af 100644
--- a/Brewfile
+++ b/Brewfile
@@ -15,5 +15,5 @@
# specific language governing permissions and limitations
# under the License.
-brew "openjdk@11"
+brew "openjdk@17"
brew "sccache"
diff --git a/bom/pom.xml b/bom/pom.xml
index f9200a7e8..e4ccee02d 100644
--- a/bom/pom.xml
+++ b/bom/pom.xml
@@ -80,10 +80,10 @@ under the License.
<properties>
<arrow.vector.classifier></arrow.vector.classifier>
<!-- org.apache:apache overrides -->
- <minimalJavaBuildVersion>11</minimalJavaBuildVersion>
- <maven.compiler.source>11</maven.compiler.source>
- <maven.compiler.target>11</maven.compiler.target>
- <maven.compiler.release>11</maven.compiler.release>
+ <minimalJavaBuildVersion>17</minimalJavaBuildVersion>
+ <maven.compiler.source>17</maven.compiler.source>
+ <maven.compiler.target>17</maven.compiler.target>
+ <maven.compiler.release>17</maven.compiler.release>
</properties>
<dependencyManagement>
diff --git a/ci/docker/conda-jni.dockerfile b/ci/docker/conda-jni.dockerfile
index e14db7368..3f31b7405 100644
--- a/ci/docker/conda-jni.dockerfile
+++ b/ci/docker/conda-jni.dockerfile
@@ -17,7 +17,7 @@
FROM ghcr.io/mamba-org/micromamba:ubuntu24.04
-ARG jdk=11
+ARG jdk=17
ARG maven=3.9.9
RUN micromamba install -y \
diff --git a/ci/docker/vcpkg-jni.dockerfile b/ci/docker/vcpkg-jni.dockerfile
index d6bd322a3..f2f5d0d45 100644
--- a/ci/docker/vcpkg-jni.dockerfile
+++ b/ci/docker/vcpkg-jni.dockerfile
@@ -20,7 +20,7 @@ FROM ${base}
# Install Java
# We need Java for JNI headers, but we don't invoke Maven in this build.
-ARG java=11
+ARG java=17
RUN dnf install -y java-$java-openjdk-devel && dnf clean all
# For ci/scripts/{cpp,java}_*.sh
diff --git a/compose.yaml b/compose.yaml
index f5082a22a..fb290b22f 100644
--- a/compose.yaml
+++ b/compose.yaml
@@ -40,7 +40,7 @@ services:
# docker compose run ubuntu
# Parameters:
# MAVEN: 3.9.9
- # JDK: 11, 17, 21
+ # JDK: 17, 21
image: ${ARCH}/maven:${MAVEN}-eclipse-temurin-${JDK}
volumes:
- .:/arrow-java:delegated
@@ -60,7 +60,7 @@ services:
# docker compose run conda-jni-cdata
# Parameters:
# MAVEN: 3.9.9
- # JDK: 11, 17, 21
+ # JDK: 17, 21
image: ${REPO}:${ARCH}-conda-java-${JDK}-maven-${MAVEN}-jni-integration
build:
context: .
diff --git a/docs/source/cdata.rst b/docs/source/cdata.rst
index 9643d88df..7b2924d25 100644
--- a/docs/source/cdata.rst
+++ b/docs/source/cdata.rst
@@ -101,8 +101,8 @@ without writing JNI bindings ourselves.
<version>1.0-SNAPSHOT</version>
<properties>
- <maven.compiler.source>8</maven.compiler.source>
- <maven.compiler.target>8</maven.compiler.target>
+ <maven.compiler.source>17</maven.compiler.source>
+ <maven.compiler.target>17</maven.compiler.target>
<arrow.version>9.0.0</arrow.version>
</properties>
<dependencies>
@@ -237,8 +237,8 @@ For this example, we will build a JAR with all dependencies
bundled.
<artifactId>cpptojava</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
- <maven.compiler.source>8</maven.compiler.source>
- <maven.compiler.target>8</maven.compiler.target>
+ <maven.compiler.source>17</maven.compiler.source>
+ <maven.compiler.target>17</maven.compiler.target>
<arrow.version>9.0.0</arrow.version>
</properties>
<dependencies>
diff --git a/docs/source/developers/building.rst
b/docs/source/developers/building.rst
index f9ef7daea..b68295771 100644
--- a/docs/source/developers/building.rst
+++ b/docs/source/developers/building.rst
@@ -32,7 +32,7 @@ Arrow Java uses the `Maven <https://maven.apache.org/>`_
build system.
Building requires:
-* JDK 11+
+* JDK 17+
* Maven 3+
.. note::
@@ -345,7 +345,7 @@ configuration file usually located under ``${HOME}/.m2``
with the following snip
<toolchain>
<type>jdk</type>
<provides>
- <version>21</version> <!-- Replace with the corresponding JDK
version: 11, 17, ... -->
+ <version>21</version> <!-- Replace with the corresponding JDK
version: 17, 21, ... -->
<vendor>temurin</vendor> <!-- Replace with the
vendor/distribution: temurin, oracle, zulu ... -->
</provides>
<configuration>
@@ -383,11 +383,11 @@ Arrow repository, and update the following settings:
right click the directory, and select Mark Directory as > Generated Sources
Root. There is no need to mark other generated sources directories, as only
the ``vector`` module generates sources.
-* For JDK 11, due to an `IntelliJ bug
- <https://youtrack.jetbrains.com/issue/IDEA-201168>`__, you must go into
+* Due to an `IntelliJ bug
+ <https://youtrack.jetbrains.com/issue/IDEA-201168>`__, you may need to go
into
Settings > Build, Execution, Deployment > Compiler > Java Compiler and
disable
"Use '--release' option for cross-compilation (Java 9 and later)". Otherwise
- you will get an error like "package sun.misc does not exist".
+ you may get an error like "package sun.misc does not exist".
* You may want to disable error-prone entirely if it gives spurious
warnings (disable both error-prone profiles in the Maven tool window
and "Reload All Maven Projects").
@@ -397,7 +397,7 @@ Arrow repository, and update the following settings:
* To enable debugging JNI-based modules like ``dataset``,
activate specific profiles in the Maven tab under "Profiles".
Ensure the profiles ``arrow-c-data``, ``arrow-jni``,
``generate-libs-cdata-all-os``,
- ``generate-libs-jni-macos-linux``, and ``jdk11+`` are enabled, so that the
+ ``generate-libs-jni-macos-linux``, and ``jdk17+`` are enabled, so that the
IDE can build them and enable debugging.
You may not need to update all of these settings if you build/test with the
@@ -478,8 +478,8 @@ Installing Manually
.. code-block:: xml
<properties>
- <maven.compiler.source>8</maven.compiler.source>
- <maven.compiler.target>8</maven.compiler.target>
+ <maven.compiler.source>17</maven.compiler.source>
+ <maven.compiler.target>17</maven.compiler.target>
<arrow.version>9.0.0.dev501</arrow.version>
</properties>
diff --git a/docs/source/flight_sql_jdbc_driver.rst
b/docs/source/flight_sql_jdbc_driver.rst
index 4deb726b3..6d40434a2 100644
--- a/docs/source/flight_sql_jdbc_driver.rst
+++ b/docs/source/flight_sql_jdbc_driver.rst
@@ -27,7 +27,7 @@ Flight SQL.
Installation and Requirements
=============================
-The driver is compatible with JDK 11+. Note that the following JVM
+The driver is compatible with JDK 17+. Note that the following JVM
parameter is required:
.. code-block:: shell
diff --git a/docs/source/install.rst b/docs/source/install.rst
index b2b1c7163..e0b34515e 100644
--- a/docs/source/install.rst
+++ b/docs/source/install.rst
@@ -27,8 +27,8 @@ Java modules are regularly built and tested on macOS and
Linux distributions.
Java Compatibility
==================
-Java modules are compatible with JDK 11 and above. Currently, JDK versions
-11, 17, 21, and latest are tested in CI.
+Java modules are compatible with JDK 17 and above. Currently, JDK versions
+17, 21, and latest are tested in CI.
Note that some JDK internals must be exposed by
adding
``--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED`` to
the ``java`` command:
diff --git a/docs/source/jdbc.rst b/docs/source/jdbc.rst
index 2f57c34bf..e054127fa 100644
--- a/docs/source/jdbc.rst
+++ b/docs/source/jdbc.rst
@@ -276,7 +276,7 @@ mapping, with additional support for the UUID extension
type noted below.
JDBC value, because a JDBC Timestamp is in UTC, and we have no
timezone information. In this case, the default binder will call
`setTimestamp(int, Timestamp)
-
<https://docs.oracle.com/en/java/javase/11/docs/api/java.sql/java/sql/PreparedStatement.html#setTimestamp(int,java.sql.Timestamp)>`_,
+
<https://docs.oracle.com/en/java/javase/17/docs/api/java.sql/java/sql/PreparedStatement.html#setTimestamp(int,java.sql.Timestamp)>`_,
which will lead to the driver using the "default timezone" (that of
the Java VM).
* \(3) For the Flight SQL JDBC driver, the Arrow UUID extension type
diff --git a/docs/source/memory.rst b/docs/source/memory.rst
index 4a71ed846..5b9148223 100644
--- a/docs/source/memory.rst
+++ b/docs/source/memory.rst
@@ -341,7 +341,7 @@ How this works:
.. _`newChildAllocator`:
https://arrow.apache.org/java/current/reference/org.apache.arrow.memory.core/org/apache/arrow/memory/RootAllocator.html#newChildAllocator-java.lang.String-org.apache.arrow.memory.AllocationListener-long-long-
.. _`Netty`: https://netty.io/wiki/
.. _`sun.misc.unsafe`:
https://web.archive.org/web/20210929024401/http://www.docjar.com/html/api/sun/misc/Unsafe.java.html
-.. _`Direct Memory`:
https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/ByteBuffer.html
+.. _`Direct Memory`:
https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/nio/ByteBuffer.html
.. _`ReferenceManager`:
https://arrow.apache.org/java/current/reference/org.apache.arrow.memory.core/org/apache/arrow/memory/ReferenceManager.html
.. _`ReferenceManager.release`:
https://arrow.apache.org/java/current/reference/org.apache.arrow.memory.core/org/apache/arrow/memory/ReferenceManager.html#release--
.. _`ReferenceManager.retain`:
https://arrow.apache.org/java/current/reference/org.apache.arrow.memory.core/org/apache/arrow/memory/ReferenceManager.html#retain--
diff --git a/pom.xml b/pom.xml
index fe5716a5f..863169b47 100644
--- a/pom.xml
+++ b/pom.xml
@@ -119,10 +119,10 @@ under the License.
<!-- List of add-opens arg line arguments for tests -->
<surefire.add-opens.argLine>--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED</surefire.add-opens.argLine>
<!-- org.apache:apache overrides -->
- <minimalJavaBuildVersion>11</minimalJavaBuildVersion>
- <maven.compiler.source>11</maven.compiler.source>
- <maven.compiler.target>11</maven.compiler.target>
- <maven.compiler.release>11</maven.compiler.release>
+ <minimalJavaBuildVersion>17</minimalJavaBuildVersion>
+ <maven.compiler.source>17</maven.compiler.source>
+ <maven.compiler.target>17</maven.compiler.target>
+ <maven.compiler.release>17</maven.compiler.release>
<!--
Downgrade maven-jar-plugin until
https://github.com/codehaus-plexus/plexus-archiver/issues/332
is addressed
@@ -1246,7 +1246,7 @@ under the License.
<property>arrow.test.jdk-version</property>
<message>"JDK version used for test must be
specified."</message>
<regex>^\d{2,}</regex>
- <regexMessage>"JDK version used for test must be 11, 17,
21, ..."</regexMessage>
+ <regexMessage>"JDK version used for test must be 17, 21,
..."</regexMessage>
</requireProperty>
</rules>
</configuration>
diff --git a/vector/src/main/codegen/templates/HolderReaderImpl.java
b/vector/src/main/codegen/templates/HolderReaderImpl.java
index 1151ea5d3..cdbb65c4f 100644
--- a/vector/src/main/codegen/templates/HolderReaderImpl.java
+++ b/vector/src/main/codegen/templates/HolderReaderImpl.java
@@ -126,7 +126,7 @@ public class ${holderMode}${name}HolderReaderImpl extends
AbstractFieldReader {
<#elseif minor.class == "Duration">
return DurationVector.toDuration(holder.value, holder.unit);
<#elseif minor.class == "Bit" >
- return new Boolean(holder.value != 0);
+ return Boolean.valueOf(holder.value != 0);
<#elseif minor.class == "Decimal">
byte[] bytes = new byte[${type.width}];
holder.buffer.getBytes(holder.start, bytes, 0, ${type.width});
@@ -151,7 +151,7 @@ public class ${holderMode}${name}HolderReaderImpl extends
AbstractFieldReader {
<#elseif minor.class == "TimeStampNano">
return DateUtility.getLocalDateTimeFromEpochNano(holder.value);
<#else>
- ${friendlyType} value = new ${friendlyType}(this.holder.value);
+ ${friendlyType} value = ${friendlyType}.valueOf(this.holder.value);
return value;
</#if>
}