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

Commit

Permalink
Merge branch 'develop' for release of version 2.0.0
Browse files Browse the repository at this point in the history
# Conflicts solved:
#	README.md
  • Loading branch information
tofi86 committed Nov 20, 2016
2 parents 8fa3222 + 0556662 commit 7f63a2d
Show file tree
Hide file tree
Showing 4 changed files with 251 additions and 88 deletions.
18 changes: 16 additions & 2 deletions CHANGELOG.md
@@ -1,11 +1,25 @@
ChangeLog
---------

### v2.0.0 (2016-11-20)
* Localization of messages (English, German, French) (fixes #27 / PR #30, Thanks to @ebourg for his contribution)
* Improve the version of Java reported in the error messages (fixes #28)
* Send to java.com when the version of Java installed is too old (fixes #29)
* Bugfix for parsing 3-digit java release/build numbers (e.g. for 1.8.0_101) (fixes #36)
* Better search algorithm for specific Java version (fixes #35)
* Use highest available Java version for execution if `JVMversion` is NOT specified (fixes #37)
* matches the new behaviour for when `JVMversion` IS specified (#35)
* Switch to `/bin/bash` with changes in #35
* Add support for arrays of VMOptions in Apple style Info.plists (PR #25, Thanks to @spectre683 for his contribution)
* Pass command line arguments through to the application (PR #31, Thanks to @dbankieris for his contribution)
* Allow specifying `$JAVA_HOME` relative to `$AppPackageFolder` (fixes #7 / PR #26, Thanks to @toonetown for his contribution)
* This allows you to set a relative `$JAVA_HOME` via the `<LSEnvironment>` Plist key
* Which means you can bundle a custom version of Java inside your app!

### v1.0.1 (2015-11-02)
* Improved display error message with applescript (PR #22, Thanks to @ygesnel for his initial contribution)
* Improved display error message with applescript (PR #22, Thanks to @ygesnel for his initial contribution)
* Reorder search for Java VM locations when specific JVM version is required (PR #22, Thanks to @yoe for his contribution)


### v1.0.0 (2015-10-08)
* Support for a splash file (PR #19)
* For details see https://github.com/tofi86/universalJavaApplicationStub/pull/19
Expand Down
22 changes: 13 additions & 9 deletions README.md
Expand Up @@ -3,7 +3,7 @@ universalJavaApplicationStub

[![Join the chat at https://gitter.im/tofi86/universalJavaApplicationStub](https://badges.gitter.im/tofi86/universalJavaApplicationStub.svg)](https://gitter.im/tofi86/universalJavaApplicationStub?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

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.
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.


Why
Expand All @@ -17,12 +17,12 @@ Whilst developing some Java apps for Mac OS X I was facing the problem of suppor
* Apple Java 1.5/1.6: `/System/Library/Java/JavaVirtualMachines/`
* Oracle JRE 1.7/1.8: `/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/`
* Oracle JDK 1.7/1.8: `/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.
* This is because the Apple `JavaApplicationStub` only works for Apple's Java and their `Info.plist` style to store Java properties.
* To support Oracle Java 7 you would need to built a separate App package with Oracles [ANT task "Appbundler"](https://java.net/projects/appbundler).
* Thus you would need the user to know which Java distribution he has installed on his Mac. Not very user friendly...

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...

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:
Expand Down Expand Up @@ -70,14 +70,18 @@ The name of the *main class* is also retrieved from `Info.plist`. If no *main cl
There is some *foo* happening to determine which Java versions are installed – here's the list in which order system properties are checked:

1. system variable `$JAVA_HOME`
2. `/usr/libexec/java_home` symlinks
3. symlink for old Apple Java: `/Library/Java/Home/bin/java`
4. hardcoded fallback to Oracle's JRE Plugin: `/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java`
* 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)
* which allows for bundling a custom version of Java inside your app!
2. highest available Java version found in one of these locations:
* `/usr/libexec/java_home` symlinks
* Oracle's JRE Plugin: `/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java`
* Symlink for old Apple Java: `/Library/Java/Home/bin/java`

If none of these could be found or executed, an applescript error dialog is shown saying that Java need to be installed:

![Error Dialog No Java Found](/docs/java-error.png?raw=true)

Messages are localized and displayed either in English (Default), French or German. Language contributions are very welcome!

What you need to do
-------------------
Expand All @@ -94,7 +98,7 @@ Download the latest JarBundler release [from its github repo](https://github.com

:exclamation: **Attention:**
> 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)*
>
>
> 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)
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:
Expand All @@ -106,7 +110,7 @@ Then place the `universalJavaApplicationStub` from this repo in your build resou
stubfile="${resources.dir}/universalJavaApplicationStub"
useJavaXKey="true"
... >

</jarbundler>
```

Expand All @@ -124,7 +128,7 @@ Just place the `universalJavaApplicationStub` from this repo in your build resou
icon="${resources.dir}/icon.icns"
executableName="${resources.dir}/universalJavaApplicationStub"
... >

</appbundler>
```

Expand Down

0 comments on commit 7f63a2d

Please sign in to comment.