Skip to content

Commit 01affd7

Browse files
authored
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.
1 parent d549791 commit 01affd7

File tree

16 files changed

+40
-40
lines changed

16 files changed

+40
-40
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ ARROW_REPO=ghcr.io/apache/arrow-dev
4747
ULIMIT_CORE=-1
4848

4949
# Default versions for various dependencies
50-
JDK=11
50+
JDK=17
5151
MAVEN=3.9.9
5252

5353
# Versions for various dependencies used to build artifacts

.github/workflows/rc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ jobs:
273273
run: |
274274
set -e
275275
# make brew Java available to CMake
276-
export JAVA_HOME=$(brew --prefix openjdk@11)/libexec/openjdk.jdk/Contents/Home
276+
export JAVA_HOME=$(brew --prefix openjdk@17)/libexec/openjdk.jdk/Contents/Home
277277
ci/scripts/jni_macos_build.sh . arrow build jni
278278
- name: Compress into single artifact to keep directory structure
279279
run: tar -cvzf jni-macos-${{ matrix.platform.arch }}.tar.gz jni/
@@ -317,7 +317,7 @@ jobs:
317317
- name: Set up Java
318318
uses: actions/setup-java@v5
319319
with:
320-
java-version: '11'
320+
java-version: '17'
321321
distribution: 'temurin'
322322
- name: Download Timezone Database
323323
shell: bash

.github/workflows/test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
strategy:
4646
fail-fast: false
4747
matrix:
48-
jdk: [11, 17, 21, 23]
48+
jdk: [17, 21, 23]
4949
maven: [3.9.9]
5050
image: [ubuntu, conda-jni-cdata]
5151
include:
@@ -88,10 +88,10 @@ jobs:
8888
matrix:
8989
include:
9090
- arch: AMD64
91-
jdk: 11
91+
jdk: 17
9292
macos: 15-intel
9393
- arch: AArch64
94-
jdk: 11
94+
jdk: 17
9595
macos: latest
9696
steps:
9797
- name: Set up Java
@@ -123,7 +123,7 @@ jobs:
123123
strategy:
124124
fail-fast: false
125125
matrix:
126-
jdk: [11]
126+
jdk: [17]
127127
steps:
128128
- name: Set up Java
129129
uses: actions/setup-java@v5

Brewfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
brew "openjdk@11"
18+
brew "openjdk@17"
1919
brew "sccache"

bom/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ under the License.
8080
<properties>
8181
<arrow.vector.classifier></arrow.vector.classifier>
8282
<!-- org.apache:apache overrides -->
83-
<minimalJavaBuildVersion>11</minimalJavaBuildVersion>
84-
<maven.compiler.source>11</maven.compiler.source>
85-
<maven.compiler.target>11</maven.compiler.target>
86-
<maven.compiler.release>11</maven.compiler.release>
83+
<minimalJavaBuildVersion>17</minimalJavaBuildVersion>
84+
<maven.compiler.source>17</maven.compiler.source>
85+
<maven.compiler.target>17</maven.compiler.target>
86+
<maven.compiler.release>17</maven.compiler.release>
8787
</properties>
8888

8989
<dependencyManagement>

ci/docker/conda-jni.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
FROM ghcr.io/mamba-org/micromamba:ubuntu24.04
1919

20-
ARG jdk=11
20+
ARG jdk=17
2121
ARG maven=3.9.9
2222

2323
RUN micromamba install -y \

ci/docker/vcpkg-jni.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ FROM ${base}
2020

2121
# Install Java
2222
# We need Java for JNI headers, but we don't invoke Maven in this build.
23-
ARG java=11
23+
ARG java=17
2424
RUN dnf install -y java-$java-openjdk-devel && dnf clean all
2525

2626
# For ci/scripts/{cpp,java}_*.sh

compose.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ services:
4040
# docker compose run ubuntu
4141
# Parameters:
4242
# MAVEN: 3.9.9
43-
# JDK: 11, 17, 21
43+
# JDK: 17, 21
4444
image: ${ARCH}/maven:${MAVEN}-eclipse-temurin-${JDK}
4545
volumes:
4646
- .:/arrow-java:delegated
@@ -60,7 +60,7 @@ services:
6060
# docker compose run conda-jni-cdata
6161
# Parameters:
6262
# MAVEN: 3.9.9
63-
# JDK: 11, 17, 21
63+
# JDK: 17, 21
6464
image: ${REPO}:${ARCH}-conda-java-${JDK}-maven-${MAVEN}-jni-integration
6565
build:
6666
context: .

docs/source/cdata.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ without writing JNI bindings ourselves.
101101
<version>1.0-SNAPSHOT</version>
102102
103103
<properties>
104-
<maven.compiler.source>8</maven.compiler.source>
105-
<maven.compiler.target>8</maven.compiler.target>
104+
<maven.compiler.source>17</maven.compiler.source>
105+
<maven.compiler.target>17</maven.compiler.target>
106106
<arrow.version>9.0.0</arrow.version>
107107
</properties>
108108
<dependencies>
@@ -237,8 +237,8 @@ For this example, we will build a JAR with all dependencies bundled.
237237
<artifactId>cpptojava</artifactId>
238238
<version>1.0-SNAPSHOT</version>
239239
<properties>
240-
<maven.compiler.source>8</maven.compiler.source>
241-
<maven.compiler.target>8</maven.compiler.target>
240+
<maven.compiler.source>17</maven.compiler.source>
241+
<maven.compiler.target>17</maven.compiler.target>
242242
<arrow.version>9.0.0</arrow.version>
243243
</properties>
244244
<dependencies>

docs/source/developers/building.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Arrow Java uses the `Maven <https://maven.apache.org/>`_ build system.
3232

3333
Building requires:
3434

35-
* JDK 11+
35+
* JDK 17+
3636
* Maven 3+
3737

3838
.. note::
@@ -345,7 +345,7 @@ configuration file usually located under ``${HOME}/.m2`` with the following snip
345345
<toolchain>
346346
<type>jdk</type>
347347
<provides>
348-
<version>21</version> <!-- Replace with the corresponding JDK version: 11, 17, ... -->
348+
<version>21</version> <!-- Replace with the corresponding JDK version: 17, 21, ... -->
349349
<vendor>temurin</vendor> <!-- Replace with the vendor/distribution: temurin, oracle, zulu ... -->
350350
</provides>
351351
<configuration>
@@ -383,11 +383,11 @@ Arrow repository, and update the following settings:
383383
right click the directory, and select Mark Directory as > Generated Sources
384384
Root. There is no need to mark other generated sources directories, as only
385385
the ``vector`` module generates sources.
386-
* For JDK 11, due to an `IntelliJ bug
387-
<https://youtrack.jetbrains.com/issue/IDEA-201168>`__, you must go into
386+
* Due to an `IntelliJ bug
387+
<https://youtrack.jetbrains.com/issue/IDEA-201168>`__, you may need to go into
388388
Settings > Build, Execution, Deployment > Compiler > Java Compiler and disable
389389
"Use '--release' option for cross-compilation (Java 9 and later)". Otherwise
390-
you will get an error like "package sun.misc does not exist".
390+
you may get an error like "package sun.misc does not exist".
391391
* You may want to disable error-prone entirely if it gives spurious
392392
warnings (disable both error-prone profiles in the Maven tool window
393393
and "Reload All Maven Projects").
@@ -397,7 +397,7 @@ Arrow repository, and update the following settings:
397397
* To enable debugging JNI-based modules like ``dataset``,
398398
activate specific profiles in the Maven tab under "Profiles".
399399
Ensure the profiles ``arrow-c-data``, ``arrow-jni``, ``generate-libs-cdata-all-os``,
400-
``generate-libs-jni-macos-linux``, and ``jdk11+`` are enabled, so that the
400+
``generate-libs-jni-macos-linux``, and ``jdk17+`` are enabled, so that the
401401
IDE can build them and enable debugging.
402402

403403
You may not need to update all of these settings if you build/test with the
@@ -478,8 +478,8 @@ Installing Manually
478478
.. code-block:: xml
479479
480480
<properties>
481-
<maven.compiler.source>8</maven.compiler.source>
482-
<maven.compiler.target>8</maven.compiler.target>
481+
<maven.compiler.source>17</maven.compiler.source>
482+
<maven.compiler.target>17</maven.compiler.target>
483483
<arrow.version>9.0.0.dev501</arrow.version>
484484
</properties>
485485

0 commit comments

Comments
 (0)