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

Commit ff5b7fe

Browse files
committed
Improve the version of Java reported in the error messages / fixes #28
"1.7" will be displayed as "7" "1.7+" will be displayed as "7 or later" "1.7*" will be displayed as "7 (latest update)"
1 parent 2aad8c1 commit ff5b7fe

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
ChangeLog
22
---------
33

4+
### v1.1.0 (Work-In-Progress)
5+
* Improve the version of Java reported in the error messages (fixes #28)
6+
7+
48
### v1.0.1 (2015-11-02)
5-
* Improved display error message with applescript (PR #22, Thanks to @ygesnel for his initial contribution)
9+
* Improved display error message with applescript (PR #22, Thanks to @ygesnel for his initial contribution)
610
* Reorder search for Java VM locations when specific JVM version is required (PR #22, Thanks to @yoe for his contribution)
711

812

src/universalJavaApplicationStub

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# #
1414
# @author Tobias Fischer #
1515
# @url https://github.com/tofi86/universalJavaApplicationStub #
16-
# @date 2015-11-02 #
16+
# @date 2016-07-03 #
1717
# @version 1.0.1 #
1818
# #
1919
# #
@@ -320,8 +320,10 @@ elif [ ! -z ${JVMVersion} ] ; then
320320
JAVACMD="${apple_jre_plugin}"
321321

322322
else
323+
# display human readable java version (#28)
324+
java_version_hr=`echo ${JVMVersion} | sed -E 's/[0-9]\.([0-9+*]+)/\1/g' | sed 's/+/ or later/' | sed 's/*/ (latest update)/'`
323325
# display error message with applescript
324-
osascript -e "tell application \"System Events\" to display dialog \"ERROR launching '${CFBundleName}'\n\nNo suitable Java version found on your system!\nThis program requires Java ${JVMVersion}\nMake sure you install the required Java version.\" with title \"${CFBundleName}\" buttons {\" OK \"} default button 1 with icon path to resource \"${CFBundleIconFile}\" in bundle (path to me)"
326+
osascript -e "tell application \"System Events\" to display dialog \"ERROR launching '${CFBundleName}'\n\nNo suitable Java version found on your system!\nThis program requires Java ${java_version_hr}\nMake sure you install the required Java version.\" with title \"${CFBundleName}\" buttons {\" OK \"} default button 1 with icon path to resource \"${CFBundleIconFile}\" in bundle (path to me)"
325327
# exit with error
326328
exit 3
327329
fi

0 commit comments

Comments
 (0)