Skip to content

Commit 2ae5f86

Browse files
committed
Use a global variable to define min java version in launcher scripts
1 parent 6c9f86a commit 2ae5f86

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

eclair-front/src/main/resources/eclair-front.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ java_version_check() {
283283
if [[ "$java_version" == "" ]]; then
284284
echo
285285
echo No java installations was detected.
286-
echo Please go to 'https://adoptium.net/temurin/releases/?package=jre&version=21' and download
286+
echo Please go to "https://adoptium.net/temurin/releases/?package=jdk&version=$min_java_version" and download
287287
echo a valid Java Runtime and install before running eclair-front.
288288
echo
289289
exit 1
@@ -292,12 +292,12 @@ java_version_check() {
292292
if [[ "$major" -eq "1" ]]; then
293293
local major=$(echo "$java_version" | cut -d'.' -f2)
294294
fi
295-
if [[ "$major" -lt "21" ]]; then
295+
if [[ "$major" -lt "$min_java_version" ]]; then
296296
echo
297297
echo The java installation you have is not up to date, eclair-front requires
298-
echo at least version 21+ \(version 21 recommended\) but you have version $java_version
298+
echo at least version ${min_java_version}+ \(version $min_java_version recommended\) but you have version $java_version
299299
echo
300-
echo Please go to 'https://adoptium.net/temurin/releases/?package=jre&version=21' and download
300+
echo Please go to "https://adoptium.net/temurin/releases/?package=jdk&version=$min_java_version" and download
301301
echo a valid Java Runtime and install before running eclair-front.
302302
echo
303303
exit 1
@@ -352,6 +352,7 @@ declare -r lib_dir=("$app_home/lib")
352352
declare -r app_mainclass=("fr.acinq.eclair.Boot")
353353
declare -r app_entrypoint=$(ls $lib_dir | grep eclair-front) # TODO: improve this
354354
declare -r app_classpath=("$lib_dir:$lib_dir/$app_entrypoint")
355+
declare -ir min_java_version=21
355356

356357
# java_cmd is overrode in process_args when -java-home is used
357358
declare java_cmd=$(get_java_cmd)

eclair-node/src/main/resources/eclair-node.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ java_version_check() {
283283
if [[ "$java_version" == "" ]]; then
284284
echo
285285
echo No java installations was detected.
286-
echo Please go to 'https://adoptium.net/temurin/releases/?package=jdk&version=21' and download
286+
echo Please go to 'https://adoptium.net/temurin/releases/?package=jdk&version=$min_java_version' and download
287287
echo a valid Java Runtime and install before running eclair-node.
288288
echo
289289
exit 1
@@ -292,12 +292,12 @@ java_version_check() {
292292
if [[ "$major" -eq "1" ]]; then
293293
local major=$(echo "$java_version" | cut -d'.' -f2)
294294
fi
295-
if [[ "$major" -lt "21" ]]; then
295+
if [[ "$major" -lt "$min_java_version" ]]; then
296296
echo
297297
echo The java installation you have is not up to date, eclair-node requires
298-
echo at least version 21+ \(version 21 recommended\) but you have version $java_version
298+
echo at least version ${min_java_version}+ \(version $min_java_version recommended\) but you have version $java_version
299299
echo
300-
echo Please go to 'https://adoptium.net/temurin/releases/?package=jdk&version=21' and download
300+
echo Please go to "https://adoptium.net/temurin/releases/?package=jdk&version=$min_java_version" and download
301301
echo a valid Java Runtime and install before running eclair-node.
302302
echo
303303
exit 1
@@ -352,6 +352,7 @@ declare -r lib_dir="$(realpath "${app_home:0:${#app_home}-4}/lib")" # {app_home:
352352
declare -a app_mainclass=("fr.acinq.eclair.Boot")
353353
declare -a app_entrypoint=$(ls "$lib_dir" | grep eclair-node) # TODO: improve this
354354
declare -a app_classpath=("$lib_dir:$lib_dir/$app_entrypoint")
355+
declare -ir min_java_version=21
355356

356357
# java_cmd is overrode in process_args when -java-home is used
357358
declare java_cmd=$(get_java_cmd)

0 commit comments

Comments
 (0)