Skip to content

Commit

Permalink
Add Java 17 support
Browse files Browse the repository at this point in the history
  • Loading branch information
udda1996 committed Jul 18, 2023
1 parent 45f64bd commit 28fe19b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 19 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
group=org.ballerinalang
version=1.3.16-SNAPSHOT
ballerinaJreVersion=1.1.0
jreVersion=11.0.18+10
jreVersion=17.0.7+7

# For test purpose
swan-lake-version=2201.2.0
Expand Down
8 changes: 5 additions & 3 deletions resources/bin/bal
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@
fi

JAVA_COMMAND=java
if test -d "$CURRENT_PATH/../dependencies/jdk-11.0.18+10-jre";then
if test -d "$CURRENT_PATH/../dependencies/jdk-17.0.7+7-jre"; then
JAVA_COMMAND="$CURRENT_PATH/../dependencies/jdk-17.0.7+7-jre/bin/java"
elif test -d "$CURRENT_PATH/../dependencies/jdk-11.0.18+10-jre"; then
JAVA_COMMAND="$CURRENT_PATH/../dependencies/jdk-11.0.18+10-jre/bin/java"
elif test -d "$CURRENT_PATH/../dependencies/jdk-11.0.15+10-jre";then
elif test -d "$CURRENT_PATH/../dependencies/jdk-11.0.15+10-jre"; then
JAVA_COMMAND="$CURRENT_PATH/../dependencies/jdk-11.0.15+10-jre/bin/java"
elif test -d "$CURRENT_PATH/../dependencies/jdk-11.0.8+10-jre";then
elif test -d "$CURRENT_PATH/../dependencies/jdk-11.0.8+10-jre"; then
JAVA_COMMAND="$CURRENT_PATH/../dependencies/jdk-11.0.8+10-jre/bin/java"
elif test -d "$CURRENT_PATH/../dependencies/jdk8u265-b01-jre"; then
JAVA_COMMAND="$CURRENT_PATH/../dependencies/jdk8u265-b01-jre/bin/java"
Expand Down
34 changes: 19 additions & 15 deletions resources/bin/bal.bat
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,31 @@ if "%1" == "update" set update=true
if "%1" == "build" set build=true
SetLocal EnableDelayedExpansion

if exist %CURRENT_PATH%..\dependencies\jdk-11.0.18+10-jre (
set JAVA_CMD=%CURRENT_PATH%..\dependencies\jdk-11.0.18+10-jre\bin\java
if exist %CURRENT_PATH%..\dependencies\jdk-17.0.7+7-jre (
set JAVA_CMD=%CURRENT_PATH%..\dependencies\jdk-17.0.7+7-jre\bin\java
) else (
if exist %CURRENT_PATH%..\dependencies\jdk-11.0.15+10-jre (
set JAVA_CMD=%CURRENT_PATH%..\dependencies\jdk-11.0.15+10-jre\bin\java
if exist %CURRENT_PATH%..\dependencies\jdk-11.0.18+10-jre (
set JAVA_CMD=%CURRENT_PATH%..\dependencies\jdk-11.0.18+10-jre\bin\java
) else (
if exist %CURRENT_PATH%..\dependencies\jdk-11.0.8+10-jre (
set JAVA_CMD=%CURRENT_PATH%..\dependencies\jdk-11.0.8+10-jre\bin\java
if exist %CURRENT_PATH%..\dependencies\jdk-11.0.15+10-jre (
set JAVA_CMD=%CURRENT_PATH%..\dependencies\jdk-11.0.15+10-jre\bin\java
) else (
if exist %CURRENT_PATH%..\dependencies\jdk8u332-b09-jre (
set JAVA_CMD=%CURRENT_PATH%..\dependencies\jdk8u332-b09-jre\bin\java
if exist %CURRENT_PATH%..\dependencies\jdk-11.0.8+10-jre (
set JAVA_CMD=%CURRENT_PATH%..\dependencies\jdk-11.0.8+10-jre\bin\java
) else (
if exist %CURRENT_PATH%..\dependencies\jdk8u265-b01-jre (
set JAVA_CMD=%CURRENT_PATH%..\dependencies\jdk8u265-b01-jre\bin\java
if exist %CURRENT_PATH%..\dependencies\jdk8u332-b09-jre (
set JAVA_CMD=%CURRENT_PATH%..\dependencies\jdk8u332-b09-jre\bin\java
) else (
if exist %CURRENT_PATH%..\dependencies\jdk8u202-b08-jre (
set JAVA_CMD=%CURRENT_PATH%..\dependencies\jdk8u202-b08-jre\bin\java
if exist %CURRENT_PATH%..\dependencies\jdk8u265-b01-jre (
set JAVA_CMD=%CURRENT_PATH%..\dependencies\jdk8u265-b01-jre\bin\java
) else (
if not exist "%JAVA_HOME%" (
echo Compatible JRE not found. Please follow the instructions in ^<BALLERINA_HOME^>\INSTALL.txt to install and setup Ballerina.
exit /b
if exist %CURRENT_PATH%..\dependencies\jdk8u202-b08-jre (
set JAVA_CMD=%CURRENT_PATH%..\dependencies\jdk8u202-b08-jre\bin\java
) else (
if not exist "%JAVA_HOME%" (
echo Compatible JRE not found. Please follow the instructions in ^<BALLERINA_HOME^>\INSTALL.txt to install and setup Ballerina.
exit /b
)
)
)
)
Expand Down

0 comments on commit 28fe19b

Please sign in to comment.