Skip to content

Commit a47ceef

Browse files
committed
Add support for Java 24
Signed-off-by: Paolo Di Tommaso <[email protected]>
1 parent 0121670 commit a47ceef

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
strategy:
2626
fail-fast: false
2727
matrix:
28-
java_version: [17, 23]
28+
java_version: [17, 24]
2929

3030
steps:
3131
- name: Checkout
@@ -112,7 +112,7 @@ jobs:
112112
strategy:
113113
fail-fast: false
114114
matrix:
115-
java_version: [17, 23]
115+
java_version: [17, 24]
116116
test_mode: ["test_integration", "test_parser_v2", "test_docs", "test_aws", "test_azure", "test_google", "test_wave"]
117117
steps:
118118
- name: Checkout

docs/install.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ New versions of Nextflow are released regularly. See {ref}`updating-nextflow-pag
1212

1313
## Requirements
1414

15-
Nextflow requires Bash 3.2 (or later) and [Java 17 (or later, up to 23)](http://www.oracle.com/technetwork/java/javase/downloads/index.html) to be installed. To see which version of Java you have, run the following command:
15+
Nextflow requires Bash 3.2 (or later) and [Java 17 (or later, up to 24)](http://www.oracle.com/technetwork/java/javase/downloads/index.html) to be installed. To see which version of Java you have, run the following command:
1616

1717
```{code-block} bash
1818
:class: copyable

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

launch.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,14 @@ fi
6666
JAVA_VER=$(echo "$JAVA_VER" | awk '/version/ {gsub(/"/, "", $3); print $3}')
6767
major=${BASH_REMATCH[1]}
6868
minor=${BASH_REMATCH[2]}
69-
version_check="^(17|18|19|20|21|23)"
69+
version_check="^(17|18|19|20|21|23|24)"
7070
if [[ ! $JAVA_VER =~ $version_check ]]; then
7171
echo "Error: cannot find Java or it's a wrong version -- please make sure that Java 17 or higher is installed"
7272
exit 1
7373
fi
7474
JVM_ARGS+=" -Dfile.encoding=UTF-8 -XX:+TieredCompilation -XX:TieredStopAtLevel=1"
7575
JVM_ARGS+=" --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.nio.file.spi=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.locks=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/sun.nio.fs=ALL-UNNAMED --add-opens=java.base/sun.net.www.protocol.http=ALL-UNNAMED --add-opens=java.base/sun.net.www.protocol.https=ALL-UNNAMED --add-opens=java.base/sun.net.www.protocol.ftp=ALL-UNNAMED --add-opens=java.base/sun.net.www.protocol.file=ALL-UNNAMED --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED --add-opens=java.base/jdk.internal.vm=ALL-UNNAMED --add-opens=java.base/java.util.regex=ALL-UNNAMED"
76+
[[ "$JAVA_VER" =~ ^(24) ]]&& JVM_ARGS+=" --enable-native-access=ALL-UNNAMED --sun-misc-unsafe-memory-access=allow"
7677
[[ $NXF_ENABLE_VIRTUAL_THREADS == 'true' ]] && [[ "$JAVA_VER" =~ ^(19|20) ]] && JVM_ARGS+=" --enable-preview"
7778
[[ "$JAVA_VER" =~ ^(21) ]] && [[ ! "$NXF_ENABLE_VIRTUAL_THREADS" ]] && NXF_ENABLE_VIRTUAL_THREADS=true
7879

nextflow

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,8 @@ else
344344
fi
345345
major=${BASH_REMATCH[1]}
346346
minor=${BASH_REMATCH[2]}
347-
version_check="^(17|18|19|20|21|22|23)"
348-
version_message="Java 17 or later (up to 23)"
347+
version_check="^(17|18|19|20|21|22|23|24)"
348+
version_message="Java 17 or later (up to 24)"
349349
if [[ ! $JAVA_VER =~ $version_check ]]; then
350350
echo_red "ERROR: Cannot find Java or it's a wrong version -- please make sure that $version_message is installed"
351351
if [[ "$NXF_JAVA_HOME" ]]; then
@@ -469,9 +469,13 @@ else
469469
launcher+=(--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED)
470470
launcher+=(--add-opens=java.base/jdk.internal.vm=ALL-UNNAMED)
471471
launcher+=(--add-opens=java.base/java.util.regex=ALL-UNNAMED)
472+
if [[ "$JAVA_VER" =~ ^(24) ]]; then
473+
launcher+=(--enable-native-access=ALL-UNNAMED)
474+
launcher+=(--sun-misc-unsafe-memory-access=allow)
475+
fi
472476
if [[ "$NXF_ENABLE_VIRTUAL_THREADS" == 'true' ]]; then
473477
if [[ "$JAVA_VER" =~ ^(19|20) ]]; then launcher+=(--enable-preview)
474-
elif [[ ! "$JAVA_VER" =~ ^(21|22|23) ]]; then die "Virtual threads require Java 19 or later - current version $JAVA_VER"
478+
elif [[ ! "$JAVA_VER" =~ ^(21|22|23|24) ]]; then die "Virtual threads require Java 19 or later - current version $JAVA_VER"
475479
fi
476480
fi
477481
launcher+=("${cmd_tail[@]}")

0 commit comments

Comments
 (0)