Skip to content

Commit

Permalink
Add support for Java 19
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
  • Loading branch information
pditommaso committed Nov 27, 2022
1 parent 0884e80 commit 811e7ca
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java_version: [11, 18]
java_version: [11, 19]

steps:
- name: Environment
Expand Down
2 changes: 1 addition & 1 deletion docs/getstarted.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Requirements
============

Nextflow can be used on any POSIX compatible system (Linux, OS X, etc).
It requires Bash 3.2 (or later) and `Java 11 (or later, up to 18) <http://www.oracle.com/technetwork/java/javase/downloads/index.html>`_ to be installed.
It requires Bash 3.2 (or later) and `Java 11 (or later, up to 19) <http://www.oracle.com/technetwork/java/javase/downloads/index.html>`_ to be installed.

For the execution in a cluster of computers, the use of a shared file system is required to allow
the sharing of tasks input/output files.
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 2 additions & 2 deletions launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ fi
JAVA_VER=$(echo "$JAVA_VER" | awk '/version/ {gsub(/"/, "", $3); print $3}')
major=${BASH_REMATCH[1]}
minor=${BASH_REMATCH[2]}
version_check="^(1.8|9|10|11|12|13|14|15|16|17|18)"
version_check="^(1.8|9|10|11|12|13|14|15|16|17|18|19)"
if [[ ! $JAVA_VER =~ $version_check ]]; then
echo "Error: cannot find Java or it's a wrong version -- please make sure that Java 8 or higher is installed"
exit 1
fi
JVM_ARGS+=" -Dfile.encoding=UTF-8 -XX:+TieredCompilation -XX:TieredStopAtLevel=1"
[[ $JAVA_VER =~ ^(9|10|11|12|13|14|15|16|17|18) ]] && 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"
[[ $JAVA_VER =~ ^(9|10|11|12|13|14|15|16|17|18|19) ]] && 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"

## flight recorded -- http://docs.oracle.com/javacomponents/jmc-5-4/jfr-runtime-guide/run.htm
##JVM_ARGS+=" -XX:+UnlockCommercialFeatures -XX:+FlightRecorder -XX:StartFlightRecording=duration=60s,filename=myrecording.jfr"
Expand Down
10 changes: 5 additions & 5 deletions nextflow
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@ else
version_check="^(1.7|1.8)"
version_message="Java 7 or 8"
else
version_check="^(1.8|9|10|11|12|13|14|15|16|17|18)"
version_message="Java 8 or later (up to 18)"
version_check="^(1.8|9|10|11|12|13|14|15|16|17|18|19)"
version_message="Java 8 or later (up to 19)"
fi
if [[ ! $JAVA_VER =~ $version_check ]]; then
echo_red "ERROR: Cannot find Java or it's a wrong version -- please make sure that $version_message is installed"
Expand All @@ -315,8 +315,8 @@ else
fi
exit 1
fi
if [[ ! $JAVA_VER =~ ^(11|12|13|14|15|16|17|18) ]]; then
echo_yellow "NOTE: Nextflow is not tested with Java $JAVA_VER -- It's recommended the use of version 11 up to 18\n"
if [[ ! $JAVA_VER =~ ^(11|12|13|14|15|16|17|18|19) ]]; then
echo_yellow "NOTE: Nextflow is not tested with Java $JAVA_VER -- It's recommended the use of version 11 up to 19\n"
fi
mkdir -p $(dirname "$JAVA_KEY")
[[ -f $JAVA_VER ]] && echo $JAVA_VER > "$JAVA_KEY"
Expand Down Expand Up @@ -405,7 +405,7 @@ else
cmd_base=(${BASH_REMATCH[1]})
cmd_tail=(${BASH_REMATCH[2]})

if [[ "$JAVA_VER" =~ ^(9|10|11|12|13|14|15|16|17|18) ]]; then
if [[ "$JAVA_VER" =~ ^(9|10|11|12|13|14|15|16|17|18|19) ]]; then
launcher="${cmd_base[@]}"
launcher+=(--add-opens=java.base/java.lang=ALL-UNNAMED)
launcher+=(--add-opens=java.base/java.io=ALL-UNNAMED)
Expand Down

0 comments on commit 811e7ca

Please sign in to comment.