TheInfiniteKind / appbundler

74 stars 24 forks source link

Support for Java 17? #85

Open dionisi opened 1 year ago

dionisi commented 1 year ago

Does the appbundler has support for Java 17? Now, when I try to bundle app with Java 17, startup of the application fails with JRE Load Error. Output of the command 'Contents/MacOS/JavaAppLauncher' is:

Error launching JVM Runtime (zulu-17.jre) Relative Path: '/Volumes/****/Contents/PlugIns/zulu-17.jre' (dylib: (null))
  error: JRELoadError

When I compared the folder structure for Java 11 and Java 17, it seems there is (again) a change in the structure:

 MacOS % find /Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home -name "libjli.dylib"
/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home/lib/jli/libjli.dylib
 MacOS % find /Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home -name "libjli.dylib"
/Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home/lib/libjli.dylib

More specific, the directory jli has been removed

colorizenl commented 1 year ago

@dionisi We have something in the Mac App Store that uses both Java 17 and AppBundler. However, we use Adoptium, not Zulu. Maybe that has something to do with it?

sreilly commented 1 year ago

I also use adoptium, but I'd think zulu should also work.

We do also have to do some things in order to make sure it works. For example, in our build script we make sure to do the following:

  1. Set the JVM plugin to a folder with the format XXX.jdk. MacOS needs to have an extension on that folder, though not necessarily .jdk. I wonder if macOS is also picky about other parts of the path, and maybe doesn't like the -11 part of the plugin folder? In our case we use the path Moneydance.app/Contents/Plugins/vm.jdk
  2. Under the jvm path we remove the Contents/MacOS/libjli.dylib file which is redundant anyway since it is also at Contents/Home/lib/libjli.dylib (at least on adoptium).