Jorl17/jar2app

I use bundle jdk created by jlink, codesign failed

Opened this issue · 5 comments

# craete app
jar2app my.jar -r jdk/ -b me.wener.tools -d my -i ./my.icns -j '-Xmx64M'

# codesign
codesign -s "iPhone Developer: xxx" --force --deep --verbose my.app
my.app: bundle format unrecognized, invalid, or unsuitable
In subcomponent: /Users/wener/my.app/Contents/PlugIns/jdk/Contents/Home/jre/legal/java.xml

What version of the jdk are you using?
If you can use jlink, is packaging a .app purely with javapackager an option?

Java 11, no javapackager for java 11

I have the same issue as @wenerme. I am also using java 11. I am creating a jre runtime with jlink. And reference it in the jar2ap command:
Keiths-MacBook-Air:MacAboutMenu keith$ jar2app MacAboutMenu.jar -n "MacAboutMenu" -d "Mac About Menu" -c "Copyright© 2019 KeithBartman.com" -r "/Users/keith/java-apps/MacAboutMenu/java-runtime"

I get this error:
Unable to load Java Runtime Environment

I can successfully execute it If call the java command within the package and specifying the jar to run:

./Plugins/java-runtime/bin/java -jar ./Java/MacAboutMenu.jar I know than you can specify the command to start it and I try that command above. I'm i missing something, This tool is great but if it can't hand custom bundels whell that makes it somewhat less useful. That's definitely the push in the industry to do package what you don't use. Hoping; you might have a simple resolution to this.

This is not the same issue wenerme has (codesigning).
It also does not appear to be a direct consequence of the program itself but JavaAppLauncher's design as far as I can tell.
See this potentially relevant comment.

codesign interprets java.xml (any dir name with a dot) to be some kind of bundle and then does not understand what kind of bundle it is.

You can work around this by doing something like:

find -E /Users/wener/my.app/Contents/PlugIns/jdk/Contents/Home/jre/legal/ -type d -regex ".+\..+" -exec bash -c "echo {} | sed 's/\.\///g' | sed 's/\./_/g' | xargs mv {} " \;

This effectively renames all folder names in your legal subfolder from java.something to java_something, i.e., replaces the . with and _.