[03/11] groovy git commit: Fix NoClassDefFoundError when using Java9 further
Fix NoClassDefFoundError when using Java9 further Project: http://git-wip-us.apache.org/repos/asf/groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/809a8478 Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/809a8478 Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/809a8478 Branch: refs/heads/GROOVY_2_5_X Commit: 809a84782e7e828c6c05c1c26b5b540f249b15cf Parents: 8065943 Author: sunlan Authored: Fri Sep 22 16:22:34 2017 +0800 Committer: Paul King Committed: Thu Jul 12 22:37:27 2018 +1000 -- src/bin/startGroovy | 7 +-- src/bin/startGroovy.bat | 7 ++- 2 files changed, 11 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/groovy/blob/809a8478/src/bin/startGroovy -- diff --git a/src/bin/startGroovy b/src/bin/startGroovy index ee78b68..bd40317 100644 --- a/src/bin/startGroovy +++ b/src/bin/startGroovy @@ -221,8 +221,6 @@ if $darwin; then JAVA_OPTS="$JAVA_OPTS -Xdock:name=$GROOVY_APP_NAME -Xdock:icon=$GROOVY_HOME/lib/groovy.icns" fi -JAVA_OPTS="$JAVA_OPTS --add-modules ALL-SYSTEM" - # For Cygwin, switch paths to Windows format before running java if $cygwin ; then GROOVY_HOME=`cygpath --mixed "$GROOVY_HOME"` @@ -280,6 +278,11 @@ if $cygwin ; then fi startGroovy ( ) { +JAVA_VERSION=`"$JAVACMD" -version 2>&1 | awk -F '"' '/version/ {print $2}' | cut -d "_" -f1` +if [[ "$JAVA_VERSION" > "1.8.0" ]]; then +JAVA_OPTS="$JAVA_OPTS --add-modules ALL-SYSTEM" +fi + CLASS=$1 shift # Start the Profiler or the JVM http://git-wip-us.apache.org/repos/asf/groovy/blob/809a8478/src/bin/startGroovy.bat -- diff --git a/src/bin/startGroovy.bat b/src/bin/startGroovy.bat index 6b67567..3e7d385 100644 --- a/src/bin/startGroovy.bat +++ b/src/bin/startGroovy.bat @@ -266,7 +266,12 @@ if not "%TOOLS_JAR%" == "" set GROOVY_OPTS=%GROOVY_OPTS% -Dtools.jar="%TOOLS_JAR set GROOVY_OPTS=%GROOVY_OPTS% -Dgroovy.starter.conf="%STARTER_CONF%" set GROOVY_OPTS=%GROOVY_OPTS% -Dscript.name="%GROOVY_SCRIPT_NAME%" -set JAVA_OPTS=%JAVA_OPTS% --add-modules ALL-SYSTEM +for /f "tokens=3" %%g in ('java -version 2^>^&1 ^| findstr /i "version"') do ( + SET JAVA_VERSION=%%g +) +for /f "useback tokens=*" %%a in ('%JAVA_VERSION%') do set JAVA_VERSION=%%~a +set JAVA_VERSION=%JAVA_VERSION:~0,5% +if "%JAVA_VERSION%" gtr "1.8.0" set JAVA_OPTS=%JAVA_OPTS% --add-modules ALL-SYSTEM if exist "%USERPROFILE%/.groovy/postinit.bat" call "%USERPROFILE%/.groovy/postinit.bat"
groovy git commit: Fix NoClassDefFoundError when using Java9 further
Repository: groovy Updated Branches: refs/heads/GROOVY_2_6_X ef7173c2a -> ca05e9ff8 Fix NoClassDefFoundError when using Java9 further (cherry picked from commit 72b1d60) Project: http://git-wip-us.apache.org/repos/asf/groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/ca05e9ff Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/ca05e9ff Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/ca05e9ff Branch: refs/heads/GROOVY_2_6_X Commit: ca05e9ff8f217d5ac16a87fff7023a481b9c1b3f Parents: ef7173c Author: sunlanAuthored: Fri Sep 22 16:22:34 2017 +0800 Committer: sunlan Committed: Fri Sep 22 16:23:22 2017 +0800 -- src/bin/startGroovy | 7 +-- src/bin/startGroovy.bat | 7 ++- 2 files changed, 11 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/groovy/blob/ca05e9ff/src/bin/startGroovy -- diff --git a/src/bin/startGroovy b/src/bin/startGroovy index d727595..30a6f06 100644 --- a/src/bin/startGroovy +++ b/src/bin/startGroovy @@ -220,8 +220,6 @@ if $darwin; then JAVA_OPTS="$JAVA_OPTS -Xdock:name=$GROOVY_APP_NAME -Xdock:icon=$GROOVY_HOME/lib/groovy.icns" fi -JAVA_OPTS="$JAVA_OPTS --add-modules ALL-SYSTEM" - # For Cygwin, switch paths to Windows format before running java if $cygwin ; then GROOVY_HOME=`cygpath --mixed "$GROOVY_HOME"` @@ -279,6 +277,11 @@ if $cygwin ; then fi startGroovy ( ) { +JAVA_VERSION=`"$JAVACMD" -version 2>&1 | awk -F '"' '/version/ {print $2}' | cut -d "_" -f1` +if [[ "$JAVA_VERSION" > "1.8.0" ]]; then +JAVA_OPTS="$JAVA_OPTS --add-modules ALL-SYSTEM" +fi + CLASS=$1 shift # Start the Profiler or the JVM http://git-wip-us.apache.org/repos/asf/groovy/blob/ca05e9ff/src/bin/startGroovy.bat -- diff --git a/src/bin/startGroovy.bat b/src/bin/startGroovy.bat index f21a763..afc6c95 100644 --- a/src/bin/startGroovy.bat +++ b/src/bin/startGroovy.bat @@ -266,7 +266,12 @@ if not "%TOOLS_JAR%" == "" set GROOVY_OPTS=%GROOVY_OPTS% -Dtools.jar="%TOOLS_JAR set GROOVY_OPTS=%GROOVY_OPTS% -Dgroovy.starter.conf="%STARTER_CONF%" set GROOVY_OPTS=%GROOVY_OPTS% -Dscript.name="%GROOVY_SCRIPT_NAME%" -set JAVA_OPTS=%JAVA_OPTS% --add-modules ALL-SYSTEM +for /f "tokens=3" %%g in ('java -version 2^>^&1 ^| findstr /i "version"') do ( + SET JAVA_VERSION=%%g +) +for /f "useback tokens=*" %%a in ('%JAVA_VERSION%') do set JAVA_VERSION=%%~a +set JAVA_VERSION=%JAVA_VERSION:~0,5% +if "%JAVA_VERSION%" gtr "1.8.0" set JAVA_OPTS=%JAVA_OPTS% --add-modules ALL-SYSTEM if exist "%USERPROFILE%/.groovy/postinit.bat" call "%USERPROFILE%/.groovy/postinit.bat"
groovy git commit: Fix NoClassDefFoundError when using Java9 further
Repository: groovy Updated Branches: refs/heads/master 412ec8e01 -> 72b1d607b Fix NoClassDefFoundError when using Java9 further Project: http://git-wip-us.apache.org/repos/asf/groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/72b1d607 Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/72b1d607 Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/72b1d607 Branch: refs/heads/master Commit: 72b1d607b058b22f2f7dea7717f30e02e29b9dd6 Parents: 412ec8e Author: sunlanAuthored: Fri Sep 22 16:22:34 2017 +0800 Committer: sunlan Committed: Fri Sep 22 16:22:45 2017 +0800 -- src/bin/startGroovy | 7 +-- src/bin/startGroovy.bat | 7 ++- 2 files changed, 11 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/groovy/blob/72b1d607/src/bin/startGroovy -- diff --git a/src/bin/startGroovy b/src/bin/startGroovy index d727595..30a6f06 100644 --- a/src/bin/startGroovy +++ b/src/bin/startGroovy @@ -220,8 +220,6 @@ if $darwin; then JAVA_OPTS="$JAVA_OPTS -Xdock:name=$GROOVY_APP_NAME -Xdock:icon=$GROOVY_HOME/lib/groovy.icns" fi -JAVA_OPTS="$JAVA_OPTS --add-modules ALL-SYSTEM" - # For Cygwin, switch paths to Windows format before running java if $cygwin ; then GROOVY_HOME=`cygpath --mixed "$GROOVY_HOME"` @@ -279,6 +277,11 @@ if $cygwin ; then fi startGroovy ( ) { +JAVA_VERSION=`"$JAVACMD" -version 2>&1 | awk -F '"' '/version/ {print $2}' | cut -d "_" -f1` +if [[ "$JAVA_VERSION" > "1.8.0" ]]; then +JAVA_OPTS="$JAVA_OPTS --add-modules ALL-SYSTEM" +fi + CLASS=$1 shift # Start the Profiler or the JVM http://git-wip-us.apache.org/repos/asf/groovy/blob/72b1d607/src/bin/startGroovy.bat -- diff --git a/src/bin/startGroovy.bat b/src/bin/startGroovy.bat index f21a763..afc6c95 100644 --- a/src/bin/startGroovy.bat +++ b/src/bin/startGroovy.bat @@ -266,7 +266,12 @@ if not "%TOOLS_JAR%" == "" set GROOVY_OPTS=%GROOVY_OPTS% -Dtools.jar="%TOOLS_JAR set GROOVY_OPTS=%GROOVY_OPTS% -Dgroovy.starter.conf="%STARTER_CONF%" set GROOVY_OPTS=%GROOVY_OPTS% -Dscript.name="%GROOVY_SCRIPT_NAME%" -set JAVA_OPTS=%JAVA_OPTS% --add-modules ALL-SYSTEM +for /f "tokens=3" %%g in ('java -version 2^>^&1 ^| findstr /i "version"') do ( + SET JAVA_VERSION=%%g +) +for /f "useback tokens=*" %%a in ('%JAVA_VERSION%') do set JAVA_VERSION=%%~a +set JAVA_VERSION=%JAVA_VERSION:~0,5% +if "%JAVA_VERSION%" gtr "1.8.0" set JAVA_OPTS=%JAVA_OPTS% --add-modules ALL-SYSTEM if exist "%USERPROFILE%/.groovy/postinit.bat" call "%USERPROFILE%/.groovy/postinit.bat"