Skip to content

Commit 76fc705

Browse files
committed
GROOVY-8162: Update Groovysh to JLine3 (remove warning on recent JDKs)
1 parent b9141a6 commit 76fc705

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/bin/groovysh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ while [ -h "$PRG" ] ; do
3939
fi
4040
done
4141

42+
if [ "$(expr "$JAVA_VERSION" \> "17.")" ]; then
43+
JAVA_OPTS="$JAVA_OPTS --enable-native-access=ALL-UNNAMED"
44+
fi
45+
4246
DIRNAME="$(dirname "$PRG")"
4347

4448
. "$DIRNAME/startGroovy"

src/bin/groovysh.bat

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ if "%DIRNAME%" == "" set DIRNAME=.\
2929

3030
set CLASSNAME=org.apache.groovy.groovysh.Main
3131

32+
if "%JAVA_VERSION%" gtr "17.0" set JAVA_OPTS=%JAVA_OPTS% --enable-native-access=ALL-UNNAMED
33+
3234
"%DIRNAME%\startGroovy.bat" "%DIRNAME%" %CLASSNAME% %*
3335

3436
@rem End local scope for the variables with windows NT shell
3537
if "%OS%"=="Windows_NT" endlocal
36-
%COMSPEC% /C exit /B %ERRORLEVEL%
38+
%COMSPEC% /C exit /B %ERRORLEVEL%

0 commit comments

Comments
 (0)