Skip to content

Commit

Permalink
WINDUP-3602 Add config for jdk17 (#102)
Browse files Browse the repository at this point in the history
* Add config for linux jdk17

* Add windows support

* Enhancing script to check jdk version on linux

* WINDUP-3602 Reduced the 'add-opens' options

* Restore previous change

* Restore previous change for making jdk17 work

* Enhance java version validation

* Remove minor version validation for jdk17

---------

Co-authored-by: mrizzi <[email protected]>
  • Loading branch information
carlosthe19916 and mrizzi authored Mar 24, 2023
1 parent 022ef54 commit 8dfc345
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/main/resources/bin/windup-cli
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,16 @@ if [ ! -x "$JAVACMD" ] ; then
fi

MODULES=""
JAVAVER=`"$JAVACMD" -version 2>&1`
JAVAVER=`"$JAVACMD" -version 2>&1 | head -n 1 | cut -d '"' -f2`
case $JAVAVER in
*"11"*)
"11"*)
MODULES="--add-modules=java.se"
;;
"17"*)
MODULES="--add-modules=java.se --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.stream=ALL-UNNAMED"
;;
*)
echo " Error: a Java 11 JRE is required to run WINDUP; found [$JAVACMD -version == $JAVAVER]."
echo " Error: a Java 11 or 17 JRE is required to run WINDUP; found [$JAVACMD -version == $JAVAVER]."
exit 1
;;
esac
Expand Down
6 changes: 5 additions & 1 deletion src/main/resources/bin/windup-cli.bat
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,13 @@ if %JAVAVER_MAJOR% equ 11 (
SET MODULES="--add-modules=java.se"
goto chkFHome
)
if %JAVAVER_MAJOR% equ 17 (
SET MODULES="--add-modules=java.se --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.stream=ALL-UNNAMED"
goto chkFHome
)

echo.
echo A Java 11 JRE is required to run WINDUP. "%JAVA_HOME%\bin\java.exe" is version %JAVAVER%
echo A Java 11 or 17 JRE is required to run WINDUP. "%JAVA_HOME%\bin\java.exe" is version %JAVAVER%
echo.
goto error

Expand Down

0 comments on commit 8dfc345

Please sign in to comment.