This is an automated email from the ASF dual-hosted git repository. paulk pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/groovy.git
commit 76fc7050cd39c04214b84d6c6593de79a2290945 Author: Paul King <pa...@asert.com.au> AuthorDate: Wed Aug 6 16:09:39 2025 +1000 GROOVY-8162: Update Groovysh to JLine3 (remove warning on recent JDKs) --- src/bin/groovysh | 4 ++++ src/bin/groovysh.bat | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/bin/groovysh b/src/bin/groovysh index d1d01ba435..7a8b5db964 100644 --- a/src/bin/groovysh +++ b/src/bin/groovysh @@ -39,6 +39,10 @@ while [ -h "$PRG" ] ; do fi done +if [ "$(expr "$JAVA_VERSION" \> "17.")" ]; then + JAVA_OPTS="$JAVA_OPTS --enable-native-access=ALL-UNNAMED" +fi + DIRNAME="$(dirname "$PRG")" . "$DIRNAME/startGroovy" diff --git a/src/bin/groovysh.bat b/src/bin/groovysh.bat index e23e8a553a..18af2f7bd0 100644 --- a/src/bin/groovysh.bat +++ b/src/bin/groovysh.bat @@ -29,8 +29,10 @@ if "%DIRNAME%" == "" set DIRNAME=.\ set CLASSNAME=org.apache.groovy.groovysh.Main +if "%JAVA_VERSION%" gtr "17.0" set JAVA_OPTS=%JAVA_OPTS% --enable-native-access=ALL-UNNAMED + "%DIRNAME%\startGroovy.bat" "%DIRNAME%" %CLASSNAME% %* @rem End local scope for the variables with windows NT shell if "%OS%"=="Windows_NT" endlocal -%COMSPEC% /C exit /B %ERRORLEVEL% \ No newline at end of file +%COMSPEC% /C exit /B %ERRORLEVEL%