Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.

Commit d67d510

Browse files
committed
implements #78: offer a choice between Oracle and AdoptOpenJDK download buttons
1 parent 043afa4 commit d67d510

1 file changed

Lines changed: 14 additions & 8 deletions

File tree

src/universalJavaApplicationStub

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,8 @@ if [[ $LANG == fr* ]] ; then
347347
MSG_NO_SUITABLE_JAVA_CHECK="Merci de bien vouloir installer la version de Java requise."
348348
MSG_INSTALL_JAVA="Java doit être installé sur votre système.\nRendez-vous sur java.com et suivez les instructions d'installation..."
349349
MSG_LATER="Plus tard"
350-
MSG_VISIT_JAVA_DOT_COM="Visiter java.com"
350+
MSG_VISIT_JAVA_DOT_COM="Java by Oracle"
351+
MSG_VISIT_ADOPTOPENJDK="Java by AdoptOpenJDK"
351352

352353
# German localization
353354
elif [[ $LANG == de* ]] ; then
@@ -361,7 +362,8 @@ elif [[ $LANG == de* ]] ; then
361362
MSG_NO_SUITABLE_JAVA_CHECK="Stellen Sie sicher, dass die angeforderte Java-Version installiert ist."
362363
MSG_INSTALL_JAVA="Auf Ihrem System muss die 'Java'-Software installiert sein.\nBesuchen Sie java.com für weitere Installationshinweise."
363364
MSG_LATER="Später"
364-
MSG_VISIT_JAVA_DOT_COM="java.com öffnen"
365+
MSG_VISIT_JAVA_DOT_COM="Java von Oracle"
366+
MSG_VISIT_ADOPTOPENJDK="Java von AdoptOpenJDK"
365367

366368
# Simplifyed Chinese localization
367369
elif [[ $LANG == zh* ]] ; then
@@ -375,7 +377,8 @@ elif [[ $LANG == zh* ]] ; then
375377
MSG_NO_SUITABLE_JAVA_CHECK="请确保系统中安装了所需的Java版本"
376378
MSG_INSTALL_JAVA="你需要在Mac中安装Java运行环境!\n访问 java.com 了解如何安装。"
377379
MSG_LATER="稍后"
378-
MSG_VISIT_JAVA_DOT_COM="访问 java.com"
380+
MSG_VISIT_JAVA_DOT_COM="Java by Oracle"
381+
MSG_VISIT_ADOPTOPENJDK="Java by AdoptOpenJDK"
379382

380383
# English default localization
381384
else
@@ -389,7 +392,8 @@ else
389392
MSG_NO_SUITABLE_JAVA_CHECK="Make sure you install the required Java version."
390393
MSG_INSTALL_JAVA="You need to have JAVA installed on your Mac!\nVisit java.com for installation instructions..."
391394
MSG_LATER="Later"
392-
MSG_VISIT_JAVA_DOT_COM="Visit java.com"
395+
MSG_VISIT_JAVA_DOT_COM="Java by Oracle"
396+
MSG_VISIT_ADOPTOPENJDK="Java by AdoptOpenJDK"
393397
fi
394398

395399

@@ -717,19 +721,21 @@ if [ -z "${JAVACMD}" ] || [ ! -x "${JAVACMD}" ] ; then
717721
stub_logger "[EXIT 3] ${MSG_NO_SUITABLE_JAVA_EXPANDED}"
718722

719723
# display error message with AppleScript
720-
osascript -e "tell application \"System Events\" to display dialog \"${MSG_ERROR_LAUNCHING}\n\n${MSG_NO_SUITABLE_JAVA_EXPANDED}\n${MSG_NO_SUITABLE_JAVA_CHECK}\" with title \"${CFBundleName}\" buttons {\" OK \", \"${MSG_VISIT_JAVA_DOT_COM}\"} default button \"${MSG_VISIT_JAVA_DOT_COM}\"${DialogWithIcon}" \
724+
osascript -e "tell application \"System Events\" to display dialog \"${MSG_ERROR_LAUNCHING}\n\n${MSG_NO_SUITABLE_JAVA_EXPANDED}\n${MSG_NO_SUITABLE_JAVA_CHECK}\" with title \"${CFBundleName}\" buttons {\" OK \", \"${MSG_VISIT_JAVA_DOT_COM}\", \"${MSG_VISIT_ADOPTOPENJDK}\"} default button 1${DialogWithIcon}" \
721725
-e "set response to button returned of the result" \
722-
-e "if response is \"${MSG_VISIT_JAVA_DOT_COM}\" then open location \"http://java.com\""
726+
-e "if response is \"${MSG_VISIT_JAVA_DOT_COM}\" then open location \"https://www.java.com/download/\"" \
727+
-e "if response is \"${MSG_VISIT_ADOPTOPENJDK}\" then open location \"https://adoptopenjdk.net/releases.html\""
723728
# exit with error
724729
exit 3
725730

726731
else
727732
# log exit cause
728733
stub_logger "[EXIT 1] ${MSG_ERROR_LAUNCHING}"
729734
# display error message with AppleScript
730-
osascript -e "tell application \"System Events\" to display dialog \"${MSG_ERROR_LAUNCHING}\n\n${MSG_INSTALL_JAVA}\" with title \"${CFBundleName}\" buttons {\"${MSG_LATER}\", \"${MSG_VISIT_JAVA_DOT_COM}\"} default button \"${MSG_VISIT_JAVA_DOT_COM}\"${DialogWithIcon}" \
735+
osascript -e "tell application \"System Events\" to display dialog \"${MSG_ERROR_LAUNCHING}\n\n${MSG_INSTALL_JAVA}\" with title \"${CFBundleName}\" buttons {\"${MSG_LATER}\", \"${MSG_VISIT_JAVA_DOT_COM}\", \"${MSG_VISIT_ADOPTOPENJDK}\"} default button 1${DialogWithIcon}" \
731736
-e "set response to button returned of the result" \
732-
-e "if response is \"${MSG_VISIT_JAVA_DOT_COM}\" then open location \"http://java.com\""
737+
-e "if response is \"${MSG_VISIT_JAVA_DOT_COM}\" then open location \"https://www.java.com/download/\"" \
738+
-e "if response is \"${MSG_VISIT_ADOPTOPENJDK}\" then open location \"https://adoptopenjdk.net/releases.html\""
733739
# exit with error
734740
exit 1
735741
fi

0 commit comments

Comments
 (0)