You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 4, 2023. It is now read-only.
Copy file name to clipboardexpand all lines: README.md
+13-9
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ universalJavaApplicationStub
3
3
4
4
[](https://gitter.im/tofi86/universalJavaApplicationStub?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
5
5
6
-
A shellscript JavaApplicationStub for Java Apps on Mac OS X that works with both Apple's and Oracle's plist format. It is released under the MIT License.
6
+
A BASH based *JavaApplicationStub* for Java Apps on Mac OS X that works with both Apple's and Oracle's plist format. It is released under the MIT License.
7
7
8
8
9
9
Why
@@ -17,12 +17,12 @@ Whilst developing some Java apps for Mac OS X I was facing the problem of suppor
17
17
* Apple Java 1.5/1.6: `/System/Library/Java/JavaVirtualMachines/`
2. Mac Apps built with tools designed for Apple's Java (like Apple's JarBundler or the [ANT task "Jarbundler"](http://informagen.com/JarBundler/)) won't work on Macs with Oracle Java 7 and no Apple Java installed.
22
22
* This is because the Apple `JavaApplicationStub` only works for Apple's Java and their `Info.plist` style to store Java properties.
23
23
* To support Oracle Java 7 you would need to built a separate App package with Oracles [ANT task "Appbundler"](https://java.net/projects/appbundler).
24
24
* Thus you would need the user to know which Java distribution he has installed on his Mac. Not very user friendly...
25
-
25
+
26
26
3. Oracle uses a different syntax to store Java properties in the applications `Info.plist` file. A Java app packaged as a Mac app with Oracles Appbundler also needs a different `JavaApplicationStub` and therefore won't work on systems with Apple's Java...
27
27
28
28
4. Starting with Mac OS X 10.10 *(Yosemite)*, app packages won't open up anymore if they contain the *deprecated* Plist `Java` dictionary. This isn't confirmed by Apple, but [issue #9](https://github.com/tofi86/universalJavaApplicationStub/issues/9) leads to this assumption:
@@ -70,14 +70,18 @@ The name of the *main class* is also retrieved from `Info.plist`. If no *main cl
70
70
There is some *foo* happening to determine which Java versions are installed – here's the list in which order system properties are checked:
71
71
72
72
1. system variable `$JAVA_HOME`
73
-
2.`/usr/libexec/java_home` symlinks
74
-
3. symlink for old Apple Java: `/Library/Java/Home/bin/java`
75
-
4. hardcoded fallback to Oracle's JRE Plugin: `/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java`
73
+
* can also be set to a relative path using the [`<LSEnvironment>` Plist dictionary key](https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/20001431-106825)
74
+
* which allows for bundling a custom version of Java inside your app!
75
+
2. highest available Java version found in one of these locations:
* Symlink for old Apple Java: `/Library/Java/Home/bin/java`
76
79
77
80
If none of these could be found or executed, an applescript error dialog is shown saying that Java need to be installed:
78
81
79
82

80
83
84
+
Messages are localized and displayed either in English (Default), French or German. Language contributions are very welcome!
81
85
82
86
What you need to do
83
87
-------------------
@@ -94,7 +98,7 @@ Download the latest JarBundler release [from its github repo](https://github.com
94
98
95
99
:exclamation:**Attention:**
96
100
> Using an older version of JarBundler (e.g. [old JarBundler ≤ v2.3](http://informagen.com/JarBundler/) or [new JarBundler ≤ v3.2](https://github.com/UltraMixer/JarBundler)) might result in [issue #9](https://github.com/tofi86/universalJavaApplicationStub/issues/9)*(Mac OS X 10.10 asking to install deprecated Apple JRE 6 instead of using a newer Java version)*
97
-
>
101
+
>
98
102
> If you don't want to care about compatibility issues between OS X and Java versions, make sure to use the [latest JarBundler version ≥ 3.3](https://github.com/UltraMixer/JarBundler/releases)
99
103
100
104
Then place the `universalJavaApplicationStub` from this repo in your build resources folder and link it in your ANT task (attribute `stubfile`). Don't forget to set the newly introduced `useJavaXKey` option:
@@ -106,7 +110,7 @@ Then place the `universalJavaApplicationStub` from this repo in your build resou
0 commit comments