Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSIdentifier.isMacintosh() returns false using Oracle Java 1.7 on OSX #25

Closed
croesch opened this issue Feb 5, 2014 · 1 comment
Closed

Comments

@croesch
Copy link
Collaborator

croesch commented Feb 5, 2014

Issue by rjenks from Tuesday May 07, 2013 at 20:42 GMT
Originally opened as alexruiz/fest-swing-1.x#18


Using FEST 1.2. Works in Apple's Java 1.6, but not Oracle's Java 1.7.

The issues is that this function depends on the system property "mrj.version" which is not set in Oracle's Java 1.7 for OSX. There is a Java bug on this issue, but it's not marked as fixed until Java 8.
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7149564

Because this function returns false, isOSX() also returns false.

I'm not sure what to suggest other than to simply have isMacintosh() and isOSX() simply depend on os.name equal to "OS X" for both checks.

@croesch
Copy link
Collaborator Author

croesch commented Mar 30, 2014

Due to the note on [https://developer.apple.com/library/mac/technotes/tn2002/tn2110.html#MRJV](Identifying Java on OS X - mac developer library)

However, it is a legacy system property dating back to the Classic Mac OS, and is not
guaranteed to have a deterministic format through future releases.
Furthermore, Apple is trying to stay as close to the standard Java functionality as possible.
For these reasons, we recommend that you instead use the more standard os.name and
java.runtime.version properties for Macintosh identification in all ongoing Java development,
as outlined in this Technical Note.

isMacintosh() and isOS() will check osName.contains("OS X"). Since Mac OS 9 is really old I guess this should help for nearly all cases.

croesch added a commit that referenced this issue Mar 30, 2014
With Java 7 the system property mrj.version (which was used to identify
Mac OS in previous Java releases) doesn't return a non-null value on
Macs anymore.

Regarding to the note on
https://developer.apple.com/library/mac/technotes/tn2002/tn2110.html#MRJV
about the mrj.version, Macintoshs and Mac OS X are now identified by
checking if the system property os.name contains 'os x'.

This helps identifying Mac OS under Java 7 and following releases. But
it also removes support for identifying Mac OS 9. This shouldn't be
needed by anybody. But this commit should be changed if Mac OS 9 support
is needed!
stefanmahler pushed a commit to stefanmahler/assertj-swing that referenced this issue May 2, 2014
With Java 7 the system property mrj.version (which was used to identify
Mac OS in previous Java releases) doesn't return a non-null value on
Macs anymore.

Regarding to the note on
https://developer.apple.com/library/mac/technotes/tn2002/tn2110.html#MRJV
about the mrj.version, Macintoshs and Mac OS X are now identified by
checking if the system property os.name contains 'os x'.

This helps identifying Mac OS under Java 7 and following releases. But
it also removes support for identifying Mac OS 9. This shouldn't be
needed by anybody. But this commit should be changed if Mac OS 9 support
is needed!
croesch pushed a commit to icon-Systemhaus-GmbH/assertj-swing that referenced this issue May 19, 2014
@croesch croesch closed this as completed Jul 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant