Modify

Opened 5 months ago

Last modified 7 days ago

#18319 new defect

Can't launch JOSM.app on macOS with OpenJDK installed, instead of JRE from Oracle.

Reported by: molind Owned by: team
Priority: normal Milestone:
Component: Installer MacOS Version:
Keywords: Cc:

Description

I'm using OpenJDK during my work and keep it as only available java on my macOS. It's installed using 'brew cask install java'. After that java is available in Terminal:

evgen@Evgens-iMac Java % java --version
openjdk 13.0.1 2019-10-15
OpenJDK Runtime Environment (build 13.0.1+9)
OpenJDK 64-Bit Server VM (build 13.0.1+9, mixed mode, sharing)

I could launch: java --jar josm-snapshot-15492.jar using snapshot bundled inside JOSM.app, but when I'm trying to launch JOSM.app itself it shows an error: JRE load error as window. When i launch it from termital i see following:

evgen@Evgens-iMac MacOS % ./JOSM
2019-11-13 11:19:00.704 JOSM[84913:5495924] NSString *findJavaDylib(NSString *, _Bool, _Bool, _Bool, _Bool) Searching for a JRE.
2019-11-13 11:19:00.705 JOSM[84913:5495924] NSString *findJREDylib(int, _Bool, _Bool) JRE search exception: 'launch path not accessible'
2019-11-13 11:19:00.773 JOSM[84913:5495924] NSString *findJavaDylib(NSString *, _Bool, _Bool, _Bool, _Bool) No matching JRE or JDK found.
2019-11-13 11:19:00.773 JOSM[84913:5495924] int launch(char *, int, char **) Launchpath: (null)
2019-11-13 11:19:00.775 JOSM[84913:5495924] int launch(char *, int, char **) Error launching JVM Runtime ((null)) Relative Path: '(null)' (dylib: (null))
  error: JRELoadError

Attachments (1)

appbundler.jar (161.3 KB) - added by molind 5 months ago.

Download all attachments as: .zip

Change History (15)

comment:1 Changed 5 months ago by anonymous

Seems an additional option required for <bundleapp> in build.xml to correctly detect JRE in runtime.

comment:2 Changed 5 months ago by Don-vip

Component: CoreInstaller MacOS

comment:3 Changed 5 months ago by Don-vip

Probably a side effect of the issues listed there: https://github.com/teras/appbundler/issues

If you're a Java developer working on Mac, maybe you know what needs to be fixed? I have too little knowledge of how macOS works to fix this issue right now.

Note that OpenJDK is working on a new tool in Java 14 to package applications: https://openjdk.java.net/jeps/343

Last edited 5 months ago by Don-vip (previous) (diff)

comment:4 Changed 5 months ago by molind

I've used appbundler from https://github.com/TheInfiniteKind/appbundler/ instead of provided in tools folder and it worked.

It worked without issues on my machine with OpenJDK 13.0.1 but it worked with multiple exceptions when my colleague launched on machine with Java 1.8 1.8.0_181-b13. I think it's because of JRE version mismatch. When old version of JRE used to run code from newer JRE.

Maybe JOSM.app should include JRE used to build the app?

comment:5 in reply to:  4 ; Changed 5 months ago by Don-vip

Replying to molind@…:

I've used appbundler from https://github.com/TheInfiniteKind/appbundler/ instead of provided in tools folder and it worked.

Where is the binary? I don't see any release on this repo.

It worked without issues on my machine with OpenJDK 13.0.1 but it worked with multiple exceptions when my colleague launched on machine with Java 1.8 1.8.0_181-b13. I think it's because of JRE version mismatch. When old version of JRE used to run code from newer JRE.

Can you please report the issues to the author? If we switch to it still must be compatible with java 8.

Maybe JOSM.app should include JRE used to build the app?

It shouldn't be necessary.

comment:6 in reply to:  5 Changed 5 months ago by anonymous

Replying to Don-vip:

Replying to molind@…:

I've used appbundler from https://github.com/TheInfiniteKind/appbundler/ instead of provided in tools folder and it worked.

Where is the binary? I don't see any release on this repo.

I just built it using ant.

It worked without issues on my machine with OpenJDK 13.0.1 but it worked with multiple exceptions when my colleague launched on machine with Java 1.8 1.8.0_181-b13. I think it's because of JRE version mismatch. When old version of JRE used to run code from newer JRE.

Can you please report the issues to the author? If we switch to it still must be compatible with java 8.

Just to be clear. It wasn't appbundler issue, but JOSM issue.

Maybe JOSM.app should include JRE used to build the app?

It shouldn't be necessary.

Okay. I'll submit crashes right away. And post links right there.

Last edited 5 months ago by molind (previous) (diff)

Changed 5 months ago by molind

Attachment: appbundler.jar added

comment:8 Changed 6 weeks ago by Stereo

The advantages of switching to OpenJDK on Retina displays are so considerable (see #18720) that I think it would make sense to jump to supporting only OpenJDK, and closing this ticket with the proposed fix despite all of the flaws it currently has.

A temporary workaround is to launch josm from the command line, java -jar /Applications/JOSM.app/Contents/Java/josm-*.jar

comment:9 in reply to:  8 Changed 6 weeks ago by Don-vip

Replying to Stereo:

The advantages of switching to OpenJDK on Retina displays are so considerable (see #18720)

Beware, the improvements you see are due to your switch from Java 8 to Java 13, which contains a lot of HIDPI improvements. You would have seen the same improvements with an Oracle runtime. They are 99.99% identical.

It doesn't mean however we will continue to support Oracle runtime. At the end of the year, the Java 8 Oracle binaries will no longer be provided to Windows and mac users. See #17858 for the switch to OpenWebStart/AdoptOpenJDK/Java 11.

comment:10 Changed 6 weeks ago by Stereo

Aha! I'll brew install oracle-jdk in the meanwhile then.

comment:11 Changed 6 weeks ago by Stereo

All right, it turns out there's no Oracle JRE beyond Java 8 for macOS, as far as I can tell. Installing just the Oracle 13 JDK produces the same JRELoadError.

It seems like the best path would be for JOSM to support launching from a preinstalled openjdk 13 bundle, or indeed to bundle its own JRE.

comment:12 Changed 8 days ago by Stereo

The freshly released Java 14 now has a nice new bundler.

comment:13 Changed 7 days ago by anonymous

Sounds great! Do you need any assistance to try it on macOS?

comment:14 Changed 7 days ago by molind

Last message was mine. Let me know if I could help to check it on macOS Catalina.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set.
to The owner will be changed from team to the specified user.
The owner will change to molind
as duplicate The resolution will be set to duplicate.The specified ticket will be cross-referenced with this ticket
The owner will be changed from team to anonymous.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.