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 4cb5d7b277e6e4b2e55415dcca129016cf70b6bd
Author: Paul King <[email protected]>
AuthorDate: Thu Aug 7 21:39:48 2025 +1000

    GROOVY-8162: Update Groovysh to JLine3 (fix native handling on windows)
---
 src/bin/groovysh.bat    | 2 +-
 src/bin/startGroovy.bat | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/bin/groovysh.bat b/src/bin/groovysh.bat
index 18af2f7bd0..efe1b5b7ca 100644
--- a/src/bin/groovysh.bat
+++ b/src/bin/groovysh.bat
@@ -29,7 +29,7 @@ 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
+set NATIVE_FLAG=true
 
 "%DIRNAME%\startGroovy.bat" "%DIRNAME%" %CLASSNAME% %*
 
diff --git a/src/bin/startGroovy.bat b/src/bin/startGroovy.bat
index df264e835f..2e3c8b4ea6 100644
--- a/src/bin/startGroovy.bat
+++ b/src/bin/startGroovy.bat
@@ -289,7 +289,8 @@ for /f "tokens=3" %%g in ('call "%JAVA_EXE%" -version 
2^>^&1 ^| findstr /i "vers
 for /f "useback tokens=*" %%a in ('%JAVA_VERSION%') do set JAVA_VERSION=%%~a
 set JAVA_VERSION=%JAVA_VERSION:~0,5%
 set ADD_MODULES_OPT=--add-modules
-if "%JAVA_VERSION%" gtr "1.8.0" if "%GROOVY_TURN_OFF_JAVA_WARNINGS%" == "true" 
                set JAVA_OPTS=%JAVA_OPTS% 
--add-opens=java.base/java.io=ALL-UNNAMED 
--add-opens=java.base/java.lang=ALL-UNNAMED 
--add-opens=java.base/java.lang.annotation=ALL-UNNAMED 
--add-opens=java.base/java.lang.invoke=ALL-UNNAMED 
--add-opens=java.base/java.lang.module=ALL-UNNAMED 
--add-opens=java.base/java.lang.ref=ALL-UNNAMED 
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED 
--add-opens=java.base/java.m [...]
+if "%GROOVY_TURN_OFF_JAVA_WARNINGS%" == "true"             set 
JAVA_OPTS=%JAVA_OPTS% --add-opens=java.base/java.io=ALL-UNNAMED 
--add-opens=java.base/java.lang=ALL-UNNAMED 
--add-opens=java.base/java.lang.annotation=ALL-UNNAMED 
--add-opens=java.base/java.lang.invoke=ALL-UNNAMED 
--add-opens=java.base/java.lang.module=ALL-UNNAMED 
--add-opens=java.base/java.lang.ref=ALL-UNNAMED 
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED 
--add-opens=java.base/java.math=ALL-UNNAMED --add-opens=java.bas [...]
+if "%JAVA_VERSION%" geq "17" if "%NATIVE_FLAG%" == "true"  set 
JAVA_OPTS=%JAVA_OPTS% --enable-native-access=ALL-UNNAMED
 
 if exist "%USERPROFILE%/.groovy/postinit.bat" call 
"%USERPROFILE%/.groovy/postinit.bat"
 

Reply via email to