Skip to content

Commit

Permalink
Merge pull request #44 from keizer619/jdk11
Browse files Browse the repository at this point in the history
Include any jre support
  • Loading branch information
keizer619 authored Oct 21, 2020
2 parents 9421b2f + d788bcc commit 5ba6b42
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
17 changes: 9 additions & 8 deletions resources/bin/ballerina
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ else
CURRENT_PATH="$(dirname "$(readlink -f "$0")")"
fi

JAVA_COMMAND=java
if 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"
elif test -d "$CURRENT_PATH/../dependencies/jdk8u202-b08-jre"; then
JAVA_COMMAND="$CURRENT_PATH/../dependencies/jdk8u202-b08-jre/bin/java"
fi

RUN_COMMAND=false
RUN_BALLERINA=true

Expand All @@ -38,10 +47,6 @@ fi

if [ "$RUN_COMMAND" == "true" ]
then
JAVA_COMMAND=java
if 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"
fi
if [ "$1" == "build" ]
then
$JAVA_COMMAND -jar $CURRENT_PATH/../lib/ballerina-command-@[email protected] build
Expand Down Expand Up @@ -85,10 +90,6 @@ fi
if [ "$1" == "help" ] && [ "$2" == "" ] || [ "$1" == "" ] || [ "$1" == "-h" ] || [ "$1" == "--help" ] || \
[ "$1" == "version" ] || [ "$1" == "-v" ] || [ "$1" == "--version" ]
then
JAVA_COMMAND=java
if 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"
fi
$JAVA_COMMAND -jar $CURRENT_PATH/../lib/ballerina-command-@[email protected] "$@"
exit $?
else
Expand Down
14 changes: 11 additions & 3 deletions resources/bin/ballerina.bat
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,17 @@ SetLocal EnableDelayedExpansion
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 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\jdk8u265-b01-jre (
set JAVA_CMD=%CURRENT_PATH%..\dependencies\jdk8u265-b01-jre\bin\java
) else (
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 5ba6b42

Please sign in to comment.