Closed amitjoy closed 2 years ago
Hi @amitjoy!
Please, could you try to run your app from the command line and tell me what happens?
Run next command directly from the Terminal: /Applications/OSGi.fx.app/Contents/MacOS/universalJavaApplicationStub
I hope you don't mind, but I've taken the liberty of looking at your project's build.gradle
(I guess I looked right) and found the following:
AFAIK, next line in your config is bundling a JDK with your app:
Why don't you let JavaPackager to generate a JRE for your app removing this property?
Please, could you try to run your app from the command line and tell me what happens? Run next command directly from the Terminal:
/Applications/OSGi.fx.app/Contents/MacOS/universalJavaApplicationStub
If this step doesn't throw any light, try to inspect syslog
with Console.app
, please. universalJavaApplicationStub
logs failures and other info there.
@fvarrui Thanks a lot for your quick response. I tried to run the application from command line and surprisingly it works perfectly. The application starts as usual but when I double click on the application icon, it doesn't work.
By the way, I have removed the line jrePath property from the configuration as you suggested to let javapackager generate a JRE.
When starting the application by double clicking on it, the following syslog got generated:
Library Validation failed: Rejecting '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libjli.dylib' (Team ID: none, platform: no) for process 'java(18638)' (Team ID: none, platform: no), reason: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)
I think this is why the application couldn't be started
The following contains all the syslogs while opening the application by double clicking on it:
default16:23:08.886848+0200lsd- 45683955: Checking whether application is managed at file:///Applications/OSGi.fx.app//com.osgifx
default16:23:08.925782+0200dmdReceived xpc stream event (distributed notification matching) with name: com.apple.LaunchServices.applicationRegistered user info: {
CFBundleDisplayName = "OSGi.fx";
bundleIDs = (
"com.osgifx"
);
isPlaceholder = 0;
}
default16:23:08.956732+0200loginwindow-[PersistentAppsSupport applicationReady:] | App: OSGi.fx, ready, updating active tracking timer
default16:23:08.956868+0200loginwindow-[ApplicationManager checkInAppContext:eventData:] | ApplicationManager: Checked in app : OSGi.fx
default16:23:08.996611+0200runningboarddAcquiring assertion targeting [app<application.com.osgifx.65003644.65003654(503)>:4311] from originator [daemon<com.apple.coreservices.appleevents(55)>:396] with description <RBSAssertionDescriptor| "AE/OSGi.fx" ID:183-396-2320 target:4311 attributes:[
<RBSDomainAttribute| domain:"com.apple.launchservicesd" name:"LSNotification" sourceEnvironment:"(null)">
]>
default16:23:09.912554+0200syslog[4311][universalJavaApplicationStub] [StubDir] /Applications/OSGi.fx.app/Contents/MacOS
default16:23:09.944993+0200syslog[4311][OSGi.fx] [PlistStyle] Apple
default16:23:10.067277+0200syslog[4311][OSGi.fx] [JavaRequirement] JVM minimum version:
default16:23:10.074940+0200syslog[4311][OSGi.fx] [JavaRequirement] JVM maximum version:
default16:23:10.084086+0200syslog[4311][OSGi.fx] [LanguageSearch] Checking preferred languages in macOS System Preferences...
default16:23:10.114979+0200syslog[4311][OSGi.fx] [LanguageSearch] ... found [en-IN de-DE]
default16:23:10.122754+0200syslog[4311][OSGi.fx] [LanguageSearch] ... selected 'en-IN' ('en') as the default language for the launcher stub
default16:23:10.130395+0200syslog[4311][OSGi.fx] [Language] en
default16:23:10.343471+0200syslog[4311][OSGi.fx] [JavaSearch] Checking for $JAVA_HOME ...
default16:23:10.353478+0200syslog[4311][OSGi.fx] [JavaSearch] ... found JAVA_HOME with value Contents/PlugIns/jre/Contents/Home
default16:23:10.363291+0200syslog[4311][OSGi.fx] [JavaSearch] ... parsing JAVA_HOME as relative path inside the App bundle to the executable '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/java'
default16:23:10.366272+0200kernelAMFI: '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/java' is adhoc signed.
default16:23:10.368720+0200amfid/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/java signature not valid: -67050
default16:23:10.371519+0200kernelAMFI: '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libjli.dylib' is adhoc signed.
default16:23:10.373343+0200amfid/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libjli.dylib signature not valid: -67050
error16:23:10.375098+0200kernelLibrary Validation failed: Rejecting '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libjli.dylib' (Team ID: none, platform: no) for process 'java(4419)' (Team ID: none, platform: no), reason: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)
error16:23:10.377342+0200kernelLibrary Validation failed: Rejecting '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libjli.dylib' (Team ID: none, platform: no) for process 'java(4419)' (Team ID: none, platform: no), reason: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)
default16:23:10.383965+0200ReportCrashASI found [dyld] (sensitive) 'Library not loaded: @rpath/libjli.dylib
Referenced from: /Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/java
Reason: tried: '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/./libjli.dylib' (no such file), '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/../lib/libjli.dylib' (code signature in <366E8331-0250-383A-B5D7-C02420BA71E5> '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libjli.dylib' not valid for use in process: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)), '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/./libjli.dylib' (no such file), '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/../lib/libjli.dylib' (code signature in <366E8331-0250-383A-B5D7-C02420BA71E5> '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libjli.dylib' not valid for use in process: mapped file has no Team ID and is not <…>'
default16:23:10.394217+0200syslog[4311][OSGi.fx] [JavaCommand] '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/java'
error16:23:10.402374+0200kernelLibrary Validation failed: Rejecting '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libjli.dylib' (Team ID: none, platform: no) for process 'java(4432)' (Team ID: none, platform: no), reason: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)
error16:23:10.404797+0200kernelLibrary Validation failed: Rejecting '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libjli.dylib' (Team ID: none, platform: no) for process 'java(4432)' (Team ID: none, platform: no), reason: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)
default16:23:10.409733+0200ReportCrashASI found [dyld] (sensitive) 'Library not loaded: @rpath/libjli.dylib
Referenced from: /Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/java
Reason: tried: '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/./libjli.dylib' (no such file), '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/../lib/libjli.dylib' (code signature in <366E8331-0250-383A-B5D7-C02420BA71E5> '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libjli.dylib' not valid for use in process: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)), '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/./libjli.dylib' (no such file), '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/../lib/libjli.dylib' (code signature in <366E8331-0250-383A-B5D7-C02420BA71E5> '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libjli.dylib' not valid for use in process: mapped file has no Team ID and is not <…>'
default16:23:10.415621+0200syslog[4311][OSGi.fx] [JavaVersion] / 00000000
default16:23:10.425241+0200syslog[4311][OSGi.fx] [WorkingDirectory] /Applications/OSGi.fx.app/Contents/Resources
default16:23:10.434927+0200syslog[4311][OSGi.fx] [Exec] "/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/java" -cp ".:Java/osgifx.jar" -Xdock:icon="/Applications/OSGi.fx.app/Contents/Resources/OSGi.fx.icns" -Xdock:name="OSGi.fx" aQute.launcher.pre.EmbeddedLauncher
error16:23:10.440080+0200kernelLibrary Validation failed: Rejecting '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libjli.dylib' (Team ID: none, platform: no) for process 'java(4311)' (Team ID: none, platform: no), reason: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)
error16:23:10.442338+0200kernelLibrary Validation failed: Rejecting '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libjli.dylib' (Team ID: none, platform: no) for process 'java(4311)' (Team ID: none, platform: no), reason: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)
default16:23:10.447000+0200ReportCrashASI found [dyld] (sensitive) 'Library not loaded: @rpath/libjli.dylib
Referenced from: /Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/java
Reason: tried: '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/./libjli.dylib' (no such file), '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/../lib/libjli.dylib' (code signature in <366E8331-0250-383A-B5D7-C02420BA71E5> '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libjli.dylib' not valid for use in process: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)), '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/./libjli.dylib' (no such file), '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/../lib/libjli.dylib' (code signature in <366E8331-0250-383A-B5D7-C02420BA71E5> '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libjli.dylib' not valid for use in process: mapped file has no Team ID and is not <…>'
default16:23:10.454065+0200loginwindow-[PersistentAppsSupport applicationQuit:] | for app:OSGi.fx, _appTrackingState = 2
default16:23:10.454090+0200loginwindow-[PersistentAppsSupport applicationQuit:] | App: OSGi.fx, quit, updating active tracking timer
It seems that the problem is when signing the JRE binaries, so I've been analysing the situation and seen two options (a or b),
a) Set macConfig.codesignApp
to false
and try again.
b) Set macConfig.developerId
with a valid Apple Development code sign identity.
I hope it helps!
As you said that it stopped working since v1.6.4, I checked the changelog and found this:
This piece of code include "hardened codesign" (--options runtime
) when codesigning in order to the app can be notirized. Maybe this change breaks your app. I'm going to remove this change in issue-185 branch ASAP, so you can install the plugin manully to your local repo and test it. I'll let you know when it's done.
I have diabled code signing by setting macConfig.codesignApp
property to false
. Now, the app appears on the dock and keeps jumping up and down. The Ui just never shows up.
Try to run it again from command line, please
I've added a new boolean property macConfig.hardededCodesign
and released changes to issue-185 branch. If it's set to false
, hardened codesiging is skipped. You have to install JavaPackager manually to your local repo. Please, package your app with this version (1.6.7-SNAPSHOT) and give me some feedback!
I have built the 1.6.7-SNAPSHOT
version to give it a go. The application appears on the dock but keeps on jumping up and down on the dock. The UI doesn't appear at all.
The following contains the syslogs:
default 20:24:58.242970+0200 lsd - 45683955: Checking whether application is managed at file:///Applications/OSGi.fx.app//com.osgifx
default 20:24:58.245740+0200 lsd com.osgifx:5:5:1:1:Building bundle record for app
default 20:24:58.245908+0200 lsd com.osgifx:5:5:2:1:Built bundle record for app
default 20:24:58.251550+0200 lsd com.osgifx:5:4:2:1:_LSServerRegisterItemInfo result = 0
default 20:24:58.263714+0200 runningboardd Launch request for app<application.com.osgifx.65048374.65048384(503)> is using uid 503 (divined from auid 503 euid 503)
default 20:24:58.263797+0200 runningboardd Acquiring assertion targeting app<application.com.osgifx.65048374.65048384(503)> from originator [daemon<com.apple.Dock.agent(503)>:517] with description <RBSAssertionDescriptor| "LS launch com.osgifx" ID:185-517-3883 target:app<application.com.osgifx.65048374.65048384(503)> attributes:[
<RBSDomainAttribute| domain:"com.apple.launchservicesd" name:"LaunchRoleUserInteractive" sourceEnvironment:"(null)">
]>
default 20:24:58.263885+0200 runningboardd Assertion 185-517-3883 (target:app<application.com.osgifx.65048374.65048384(503)>) will be created as active
default 20:24:58.264049+0200 runningboardd Executing launch request for app<application.com.osgifx.65048374.65048384(503)> (LS launch com.osgifx)
default 20:24:58.264092+0200 runningboardd Creating and launching job for: app<application.com.osgifx.65048374.65048384(503)>
default 20:24:58.264116+0200 runningboardd _mutateContextIfNeeded called for com.osgifx
default 20:24:58.273941+0200 runningboardd [app<application.com.osgifx.65048374.65048384(503)>:5500] This process will not be managed.
default 20:24:58.273969+0200 runningboardd [app<application.com.osgifx.65048374.65048384(503)>:5500] HOME is <private>
default 20:24:58.273988+0200 runningboardd [app<application.com.osgifx.65048374.65048384(503)>:5500] TMPDIR is <private>
default 20:24:58.274008+0200 runningboardd Now tracking process: [app<application.com.osgifx.65048374.65048384(503)>:5500]
default 20:24:58.274086+0200 runningboardd Using default underlying assertion for app: [app<application.com.osgifx.65048374.65048384(503)>:5500]
default 20:24:58.274106+0200 runningboardd Calculated state for app<application.com.osgifx.65048374.65048384(503)>: running-active (role: UserInteractive)
default 20:24:58.274207+0200 runningboardd Acquiring assertion targeting [app<application.com.osgifx.65048374.65048384(503)>:5500] from originator [app<application.com.osgifx.65048374.65048384(503)>:5500] with description <RBSAssertionDescriptor| "RB Underlying Assertion" ID:185-185-3884 target:5500 attributes:[
<RBSDomainAttribute| domain:"com.apple.underlying" name:"defaultUnderlyingAppAssertion" sourceEnvironment:"(null)">,
<RBSAcquisitionCompletionAttribute| policy:AfterApplication>
]>
default 20:24:58.274353+0200 runningboardd Assertion 185-185-3884 (target:[app<application.com.osgifx.65048374.65048384(503)>:5500]) will be created as active
default 20:24:58.274534+0200 runningboardd [app<application.com.osgifx.65048374.65048384(503)>:5500] Ignoring jetsam update because this process is not memory-managed
default 20:24:58.274569+0200 runningboardd [app<application.com.osgifx.65048374.65048384(503)>:5500] Ignoring suspend because this process is not lifecycle managed
default 20:24:58.274753+0200 runningboardd [app<application.com.osgifx.65048374.65048384(503)>:5500] Set darwin role to: UserInteractive
default 20:24:58.274920+0200 runningboardd [app<application.com.osgifx.65048374.65048384(503)>:5500] Ignoring GPU update because this process is not GPU managed
default 20:24:58.275520+0200 runningboardd Calculated state for app<application.com.osgifx.65048374.65048384(503)>: running-active (role: UserInteractive)
default 20:24:58.275973+0200 runningboardd Acquiring assertion targeting [app<application.com.osgifx.65048374.65048384(503)>:5500] from originator [daemon<com.apple.coreservices.launchservicesd>:136] with description <RBSAssertionDescriptor| "foregroundApp:5500" ID:185-136-3885 target:5500 attributes:[
<RBSDomainAttribute| domain:"com.apple.launchservicesd" name:"RoleUserInteractiveNonFocal" sourceEnvironment:"(null)">
]>
default 20:24:58.276083+0200 runningboardd Assertion 185-136-3885 (target:[app<application.com.osgifx.65048374.65048384(503)>:5500]) will be created as active
default 20:24:58.276839+0200 runningboardd Calculated state for app<application.com.osgifx.65048374.65048384(503)>: running-active (role: UserInteractive)
default 20:24:58.276874+0200 runningboardd Acquiring assertion targeting [app<application.com.osgifx.65048374.65048384(503)>:5500] from originator [daemon<com.apple.coreservices.launchservicesd>:136] with description <RBSAssertionDescriptor| "foregroundApp:5500" ID:185-136-3886 target:5500 attributes:[
<RBSDomainAttribute| domain:"com.apple.launchservicesd" name:"RoleUserInteractiveNonFocal" sourceEnvironment:"(null)">
]>
default 20:24:58.277163+0200 runningboardd Assertion 185-136-3886 (target:[app<application.com.osgifx.65048374.65048384(503)>:5500]) will be created as active
default 20:24:58.278296+0200 loginwindow -[PersistentAppsSupport applicationReady:] | App: OSGi.fx, ready, updating active tracking timer
default 20:24:58.278378+0200 loginwindow -[ApplicationManager checkInAppContext:eventData:] | ApplicationManager: Checked in app : OSGi.fx
default 20:24:58.278688+0200 runningboardd Invalidating assertion 185-136-3885 (target:[app<application.com.osgifx.65048374.65048384(503)>:5500]) from originator [daemon<com.apple.coreservices.launchservicesd>:136]
default 20:24:58.279512+0200 runningboardd Acquiring assertion targeting [app<application.com.osgifx.65048374.65048384(503)>:5500] from originator [daemon<com.apple.coreservices.launchservicesd>:136] with description <RBSAssertionDescriptor| "foregroundApp:5500" ID:185-136-3887 target:5500 attributes:[
<RBSDomainAttribute| domain:"com.apple.launchservicesd" name:"RoleUserInteractiveNonFocal" sourceEnvironment:"(null)">
]>
default 20:24:58.279684+0200 runningboardd Assertion 185-136-3887 (target:[app<application.com.osgifx.65048374.65048384(503)>:5500]) will be created as active
default 20:24:58.280190+0200 runningboardd [app<application.com.osgifx.65048374.65048384(503)>:5500] reported to RB as running
default 20:24:58.281291+0200 runningboardd [app<application.com.osgifx.65048374.65048384(503)>:5500] Ignoring jetsam update because this process is not memory-managed
default 20:24:58.281546+0200 runningboardd [app<application.com.osgifx.65048374.65048384(503)>:5500] Ignoring suspend because this process is not lifecycle managed
default 20:24:58.281754+0200 runningboardd [app<application.com.osgifx.65048374.65048384(503)>:5500] Ignoring GPU update because this process is not GPU managed
default 20:24:58.281796+0200 runningboardd Invalidating assertion 185-136-3886 (target:[app<application.com.osgifx.65048374.65048384(503)>:5500]) from originator [daemon<com.apple.coreservices.launchservicesd>:136]
default 20:24:58.282407+0200 runningboardd Successfully acquired underlying assertion for [app<application.com.osgifx.65048374.65048384(503)>:5500]
default 20:24:58.282512+0200 runningboardd [app<application.com.osgifx.65048374.65048384(503)>:5500] Ignoring jetsam update because this process is not memory-managed
default 20:24:58.282773+0200 runningboardd [app<application.com.osgifx.65048374.65048384(503)>:5500] Ignoring suspend because this process is not lifecycle managed
default 20:24:58.282979+0200 runningboardd [app<application.com.osgifx.65048374.65048384(503)>:5500] Ignoring GPU update because this process is not GPU managed
default 20:24:58.285739+0200 distnoted register name: com.apple.sharedfilelist.change object: com.apple.LSSharedFileList.ApplicationRecentDocuments/com.osgifx token: 710000003d pid: 517
default 20:24:58.297911+0200 runningboardd Acquiring assertion targeting [app<application.com.osgifx.65048374.65048384(503)>:5500] from originator [daemon<com.apple.coreservices.appleevents(55)>:398] with description <RBSAssertionDescriptor| "AE/OSGi.fx" ID:185-398-3888 target:5500 attributes:[
<RBSDomainAttribute| domain:"com.apple.launchservicesd" name:"LSNotification" sourceEnvironment:"(null)">
]>
default 20:24:58.298019+0200 runningboardd Assertion 185-398-3888 (target:[app<application.com.osgifx.65048374.65048384(503)>:5500]) will be created as active
default 20:24:58.298468+0200 runningboardd Calculated state for app<application.com.osgifx.65048374.65048384(503)>: running-active (role: UserInteractive)
default 20:24:58.298481+0200 runningboardd [app<application.com.osgifx.65048374.65048384(503)>:5500] Ignoring jetsam update because this process is not memory-managed
default 20:24:58.298926+0200 runningboardd [app<application.com.osgifx.65048374.65048384(503)>:5500] Ignoring suspend because this process is not lifecycle managed
default 20:24:58.299072+0200 runningboardd [app<application.com.osgifx.65048374.65048384(503)>:5500] Ignoring GPU update because this process is not GPU managed
default 20:24:58.299154+0200 Dock LAUNCH: 0x0-0xa60a6 com.osgifx starting stopped process.
default 20:24:58.300772+0200 runningboardd Invalidating assertion 185-517-3883 (target:app<application.com.osgifx.65048374.65048384(503)>) from originator [daemon<com.apple.Dock.agent(503)>:517]
default 20:24:58.326953+0200 dmd Received xpc stream event (distributed notification matching) with name: com.apple.LaunchServices.applicationRegistered user info: {
CFBundleDisplayName = "OSGi.fx";
bundleIDs = (
"com.osgifx"
);
isPlaceholder = 0;
}
default 20:24:58.402319+0200 runningboardd Calculated state for app<application.com.osgifx.65048374.65048384(503)>: running-active (role: UserInteractiveNonFocal)
default 20:24:58.402378+0200 runningboardd [app<application.com.osgifx.65048374.65048384(503)>:5500] Ignoring jetsam update because this process is not memory-managed
default 20:24:58.402535+0200 runningboardd [app<application.com.osgifx.65048374.65048384(503)>:5500] Ignoring suspend because this process is not lifecycle managed
default 20:24:58.402678+0200 runningboardd [app<application.com.osgifx.65048374.65048384(503)>:5500] Set darwin role to: UserInteractiveNonFocal
default 20:24:58.402812+0200 runningboardd [app<application.com.osgifx.65048374.65048384(503)>:5500] Ignoring GPU update because this process is not GPU managed
default 20:24:59.065574+0200 syspolicyd GK evaluateScanResult: 2, PST: (vuid: 2C791C77-22C7-42FC-9185-B7BB52D6A633), (objid: 65048374), (team: (null)), (id: com.osgifx), (bundle_id: com.osgifx), 0, 0, 1, 0, 0, 0
default 20:24:59.093344+0200 syslog [5500][universalJavaApplicationStub] [StubDir] /Applications/OSGi.fx.app/Contents/MacOS
default 20:24:59.121526+0200 syslog [5500][OSGi.fx] [PlistStyle] Apple
default 20:24:59.261023+0200 syslog [5500][OSGi.fx] [JavaRequirement] JVM minimum version:
default 20:24:59.269349+0200 syslog [5500][OSGi.fx] [JavaRequirement] JVM maximum version:
default 20:24:59.277378+0200 syslog [5500][OSGi.fx] [LanguageSearch] Checking preferred languages in macOS System Preferences...
default 20:24:59.303420+0200 syslog [5500][OSGi.fx] [LanguageSearch] ... found [en-IN de-DE]
default 20:24:59.311466+0200 syslog [5500][OSGi.fx] [LanguageSearch] ... selected 'en-IN' ('en') as the default language for the launcher stub
default 20:24:59.319833+0200 syslog [5500][OSGi.fx] [Language] en
default 20:24:59.692791+0200 syslog [5500][OSGi.fx] [JavaSearch] Checking for $JAVA_HOME ...
default 20:24:59.701406+0200 syslog [5500][OSGi.fx] [JavaSearch] ... found JAVA_HOME with value Contents/PlugIns/jre/Contents/Home
default 20:24:59.709218+0200 syslog [5500][OSGi.fx] [JavaSearch] ... parsing JAVA_HOME as relative path inside the App bundle to the executable '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/java'
default 20:24:59.712863+0200 kernel AMFI: '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/java' is adhoc signed.
default 20:24:59.714838+0200 amfid /Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/java signature not valid: -67050
default 20:24:59.717479+0200 kernel AMFI: '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libjli.dylib' is adhoc signed.
default 20:24:59.719440+0200 amfid /Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libjli.dylib signature not valid: -67050
default 20:24:59.728009+0200 kernel AMFI: '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/server/libjvm.dylib' is adhoc signed.
default 20:24:59.731336+0200 amfid /Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/server/libjvm.dylib signature not valid: -67050
default 20:24:59.750796+0200 kernel AMFI: '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libjimage.dylib' is adhoc signed.
default 20:24:59.752429+0200 amfid /Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libjimage.dylib signature not valid: -67050
default 20:24:59.759016+0200 kernel AMFI: '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libjava.dylib' is adhoc signed.
default 20:24:59.760796+0200 amfid /Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libjava.dylib signature not valid: -67050
default 20:24:59.767546+0200 kernel AMFI: '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libzip.dylib' is adhoc signed.
default 20:24:59.769325+0200 amfid /Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libzip.dylib signature not valid: -67050
default 20:24:59.844872+0200 syslog [5500][OSGi.fx] [JavaCommand] '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/java'
default 20:24:59.933367+0200 syslog [5500][OSGi.fx] [JavaVersion] 17.0.2 / 17000002
default 20:24:59.941700+0200 syslog [5500][OSGi.fx] [WorkingDirectory] /Applications/OSGi.fx.app/Contents/Resources
default 20:24:59.949352+0200 syslog [5500][OSGi.fx] [Exec] "/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/java" -cp ".:Java/osgifx.jar" -Xdock:icon="/Applications/OSGi.fx.app/Contents/Resources/OSGi.fx.icns" -Xdock:name="OSGi.fx" aQute.launcher.pre.EmbeddedLauncher
default 20:25:00.030797+0200 kernel AMFI: '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libnio.dylib' is adhoc signed.
default 20:25:00.032977+0200 amfid /Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libnio.dylib signature not valid: -67050
default 20:25:00.033760+0200 kernel AMFI: '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libnet.dylib' is adhoc signed.
default 20:25:00.036076+0200 amfid /Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libnet.dylib signature not valid: -67050
default 20:25:03.280117+0200 loginwindow -[PersistentAppsSupport saveLogoutPersistentState:finalSnapshot:] | previouslyRunningApps: (
{
BackgroundState = 2;
BundleID = "com.apple.terminal";
Hide = 0;
Path = "/System/Applications/Utilities/Terminal.app";
},
{
BackgroundState = 2;
BundleID = "epp.package.rcp";
Hide = 0;
Path = "/Users/amit/eclipse/osgifx/Eclipse.app";
},
{
BackgroundState = 2;
BundleID = "com.apple.safari";
Hide = 0;
Path = "/Applications/Safari.app";
},
{
BackgroundState = 2;
BundleID = "com.axosoft.gitkraken";
Hide = 0;
Path = "/Applications/GitKraken.app";
},
{
BackgroundState = 2;
BundleID = "com.apple.finder";
Hide = 0;
Path = "/System/Library/CoreServices/Finder.app";
},
{
BackgroundState = 3;
BundleID = "com.culturedcode.thingsmac";
Hide = 0;
Path = "/Applications/Things3.app";
},
{
BackgroundState = 2;
BundleID = "com.sublimetext.4";
Hide = 0;
Path = "/Applications/Sublime Text.app";
},
{
BackgroundState = 2;
BundleID = "com.apple.console";
Hide = 0;
Path = "/System/Applications/Utilities/Console.app";
},
{
BackgroundState = 2;
BundleID = "com.macpaw.cleanmymac4";
Hide = 0;
Path = "/Applications/CleanMyMac X.app";
}
)
default 20:25:03.287349+0200 loginwindow -[PersistentAppsSupport saveLogoutPersistentState:finalSnapshot:] | Contents:(
{
BackgroundState = 2;
BundleID = "com.apple.console";
Hide = 0;
Path = "/System/Applications/Utilities/Console.app";
},
{
BackgroundState = 2;
BundleID = "com.apple.terminal";
Hide = 0;
Path = "/System/Applications/Utilities/Terminal.app";
},
{
BackgroundState = 2;
BundleID = "com.apple.finder";
Hide = 0;
Path = "/System/Library/CoreServices/Finder.app";
},
{
BackgroundState = 2;
BundleID = "epp.package.rcp";
Hide = 0;
Path = "/Users/amit/eclipse/osgifx/Eclipse.app";
},
{
BackgroundState = 2;
BundleID = "com.apple.safari";
Hide = 0;
Path = "/Applications/Safari.app";
},
{
BackgroundState = 2;
BundleID = "com.sublimetext.4";
Hide = 0;
Path = "/Applications/Sublime Text.app";
},
{
BackgroundState = 2;
BundleID = "com.axosoft.gitkraken";
Hide = 0;
Path = "/Applications/GitKraken.app";
},
{
BackgroundState = 3;
BundleID = "com.culturedcode.thingsmac";
Hide = 0;
Path = "/Applications/Things3.app";
},
{
BackgroundState = 2;
BundleID = "com.macpaw.cleanmymac4";
Hide = 0;
Path = "/Applications/CleanMyMac X.app";
}
)
default 20:25:03.659006+0200 runningboardd Assertion did invalidate due to timeout: 185-185-3884 (target:[app<application.com.osgifx.65048374.65048384(503)>:5500])
default 20:25:03.659148+0200 runningboardd Assertion did invalidate due to timeout: 185-398-3888 (target:[app<application.com.osgifx.65048374.65048384(503)>:5500])
default 20:25:03.770951+0200 runningboardd Calculated state for app<application.com.osgifx.65048374.65048384(503)>: running-active (role: UserInteractiveNonFocal)
default 20:25:03.770982+0200 runningboardd [app<application.com.osgifx.65048374.65048384(503)>:5500] Ignoring jetsam update because this process is not memory-managed
default 20:25:03.771040+0200 runningboardd [app<application.com.osgifx.65048374.65048384(503)>:5500] Ignoring suspend because this process is not lifecycle managed
default 20:25:03.771094+0200 runningboardd [app<application.com.osgifx.65048374.65048384(503)>:5500] Ignoring GPU update because this process is not GPU managed
default 20:25:05.159359+0200 kernel AMFI: '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libverify.dylib' is adhoc signed.
default 20:25:05.161556+0200 amfid /Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libverify.dylib signature not valid: -67050
I've filtered your syslog output:
default 20:24:59.093344+0200 syslog [5500][universalJavaApplicationStub] [StubDir] /Applications/OSGi.fx.app/Contents/MacOS
default 20:24:59.121526+0200 syslog [5500][OSGi.fx] [PlistStyle] Apple
default 20:24:59.261023+0200 syslog [5500][OSGi.fx] [JavaRequirement] JVM minimum version:
default 20:24:59.269349+0200 syslog [5500][OSGi.fx] [JavaRequirement] JVM maximum version:
default 20:24:59.277378+0200 syslog [5500][OSGi.fx] [LanguageSearch] Checking preferred languages in macOS System Preferences...
default 20:24:59.303420+0200 syslog [5500][OSGi.fx] [LanguageSearch] ... found [en-IN de-DE]
default 20:24:59.311466+0200 syslog [5500][OSGi.fx] [LanguageSearch] ... selected 'en-IN' ('en') as the default language for the launcher stub
default 20:24:59.319833+0200 syslog [5500][OSGi.fx] [Language] en
default 20:24:59.692791+0200 syslog [5500][OSGi.fx] [JavaSearch] Checking for $JAVA_HOME ...
default 20:24:59.701406+0200 syslog [5500][OSGi.fx] [JavaSearch] ... found JAVA_HOME with value Contents/PlugIns/jre/Contents/Home
default 20:24:59.709218+0200 syslog [5500][OSGi.fx] [JavaSearch] ... parsing JAVA_HOME as relative path inside the App bundle to the executable '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/java'
default 20:24:59.712863+0200 kernel AMFI: '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/java' is adhoc signed.
default 20:24:59.714838+0200 amfid /Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/java signature not valid: -67050
default 20:24:59.717479+0200 kernel AMFI: '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libjli.dylib' is adhoc signed.
default 20:24:59.719440+0200 amfid /Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libjli.dylib signature not valid: -67050
default 20:24:59.728009+0200 kernel AMFI: '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/server/libjvm.dylib' is adhoc signed.
default 20:24:59.731336+0200 amfid /Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/server/libjvm.dylib signature not valid: -67050
default 20:24:59.750796+0200 kernel AMFI: '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libjimage.dylib' is adhoc signed.
default 20:24:59.752429+0200 amfid /Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libjimage.dylib signature not valid: -67050
default 20:24:59.759016+0200 kernel AMFI: '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libjava.dylib' is adhoc signed.
default 20:24:59.760796+0200 amfid /Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libjava.dylib signature not valid: -67050
default 20:24:59.767546+0200 kernel AMFI: '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libzip.dylib' is adhoc signed.
default 20:24:59.769325+0200 amfid /Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libzip.dylib signature not valid: -67050
default 20:24:59.844872+0200 syslog [5500][OSGi.fx] [JavaCommand] '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/java'
default 20:24:59.933367+0200 syslog [5500][OSGi.fx] [JavaVersion] 17.0.2 / 17000002
default 20:24:59.941700+0200 syslog [5500][OSGi.fx] [WorkingDirectory] /Applications/OSGi.fx.app/Contents/Resources
default 20:24:59.949352+0200 syslog [5500][OSGi.fx] [Exec] "/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/java" -cp ".:Java/osgifx.jar" -Xdock:icon="/Applications/OSGi.fx.app/Contents/Resources/OSGi.fx.icns" -Xdock:name="OSGi.fx" aQute.launcher.pre.EmbeddedLauncher
default 20:25:00.030797+0200 kernel AMFI: '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libnio.dylib' is adhoc signed.
default 20:25:00.032977+0200 amfid /Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libnio.dylib signature not valid: -67050
default 20:25:00.033760+0200 kernel AMFI: '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libnet.dylib' is adhoc signed.
default 20:25:00.036076+0200 amfid /Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libnet.dylib signature not valid: -67050
default 20:25:05.159359+0200 kernel AMFI: '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libverify.dylib' is adhoc signed.
default 20:25:05.161556+0200 amfid /Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libverify.dylib signature not valid: -67050
universalJavaApplicationStub
seems to be working fine, but your system is reporting that some JRE libraries are not signed. It seems that you can't run your app on your Mac OS if it's not codesigned, so, enable codesigning again.
Are you using any Apple Developer ID to sign your app?
I've got a Mac Mini with Mac OS 10.15 and I'll try your project when arrive at home .... could you give me some instructions in order to build your app, please?
Going back to the beginning:
Termination Reason: Namespace DYLD, Code 1 Library missing
Library not loaded: @rpath/libjli.dylib
Referenced from: /Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/java
Reason: tried: '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/./libjli.dylib' (no such file), '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/../lib/libjli.dylib' (code signature in <366E8331-0250-383A-B5D7-C02420BA71E5> '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libjli.dylib' not valid for use in process: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)), '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/./libjli.dylib' (no such file), '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/../lib/libjli.dylib' (code signature in <366E8331-0250-383A-B5D7-C02420BA71E5> '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libjli.dylib' not valid for use in process: mapped file has no Team ID and is not a platform binary (signed with cust
(terminated at launch; ignore backtrace)
Application Specific Information:
Library not loaded: @rpath/libjli.dylib
Referenced from: /Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/java
Reason: tried: '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/./libjli.dylib' (no such file), '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/../lib/libjli.dylib' (code signature in <366E8331-0250-383A-B5D7-C02420BA71E5> '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libjli.dylib' not valid for use in process: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)), '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/./libjli.dylib' (no such file), '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/bin/../lib/libjli.dylib' (code signature in <366E8331-0250-383A-B5D7-C02420BA71E5> '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libjli.dylib' not valid for use in process: mapped file has no Team ID and is not a platform binary (signed with cust
I'm not an expert, but maybe you need to disable security checks on your Mac OS to run your app, or you should sign and notarize it.
One question; you said that JavaPackager 1.6.3 worked fine for you ... did you use it on the same system? same Mac OS version? Or have you upgraded your system and then you upgrade JavaPackager from 1.6.3 to 1.6.4/.5?
@fvarrui Thanks a lot for your continuous support. Since macOS Moneterey, the code signing is required as a mandatory step which makes macOS application distribution pretty difficult. Apart from that, code signing is automatically enabled due to my system policy as it is configured by the system admin. That's why code signing cannot be disabled. That's a pain right now.
The last successful test I could perform was on 1.6.2 which can generate macOS and linux artifacts pretty easily but in case of windows (if built using Java 17) encounters ExceptionInInitializerError
and that's why I updated to 1.6.5 as a first step and then the builds succeed even for windows but the built macOS artifact doesn't work. I downgraded to 1.6.4 and the behaviour is the same. I downgraded once again and then it worked only once for 1.6.3. Yesterday I tried quite a lot of times with 1.6.3 and unfortunately it didn't work at all. And the most funny part is that, it doesn't work for 1.6.2 anymore since yesterday.
It's quite puzzling. I'm sorry I can't help you more, but I don't have a latest generation Mac and I don't have an Apple developer certificate, which costs €99 per year.
So, I guess you are not codesigning and notarizing your app with a valid Apple Developer cert and maybe this is the problem.
I'm going to ask to another JavaPackager user which had a successful story with it. Maybe he could provide us a step by step guide.
Hi @fvarrui and @amitjoy ,
@amitjoy , can your issue be fixed with the following:
1) do code sign with hardened runtime 2) add the following runtime exceptions entitlements to your entitlements file from: https://developer.apple.com/documentation/security/hardened_runtime
so an example entitlements.plist
file would look:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.disable-executable-page-protection</key>
<true/>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
</dict>
</plist>
Notice the last one, disable library validation and compare to your initial error of:
Library Validation failed: Rejecting '/Applications/OSGi.fx.app/Contents/PlugIns/jre/Contents/Home/lib/libjli.dylib'
(Team ID: none, platform: no) for process 'java(18638)' (Team ID: none, platform: no), reason:
mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)
And you need to check if the JDK that you use is properly signed I think. Old JDKs can be problem maybe?
Hope this solves it for you?
Thanks so much Mabula!!!
@amitjoy - I'll take issue with your statement
Since macOS Moneterey, the code signing is required as a mandatory step which makes macOS application distribution pretty difficult.
I've successfully compiled and run MacOS Java apps that run fine without any code signing ... I've tested the .app files with a clean install of Monterey 12.3 in a virtual machine and the app was built and compiled using the latest Java version 18.
@EasyG0ing1 , but..., without code signing (and notarization), your application will never pass the macOS gatekeeper, on latest macOS versions, without telling the user that the software is not safe to use... The user then has to manually approve it in security and privacy settings to get it to run... (which many users struggle with I know for a fact.)
So yes, it can still run and work, but it will not give the users of your software a good install experience nor cofirm to the user that your package installation is mature, would you not agree?
@fvarrui - Agreed... but the more I think about it, the only way I was able to get a packaged Java program to run on a machine without a JDK or JRE installed, was to install a JDK or a JRE, then it would run just fine ... but now I'm thinking that the reason why it would run, is because it defaulted to use those Java libraries which ARE code signed and were installed and approved for use ... so the program is basically just "piggybacking" off of previously authorized code... so I spoke too soon on this topic, as it seems that @amitjoy is correct, there is no way to run software that is not signed on Monterey.
Thanks a lot everyone for taking up the issue. I believe to ensure that the app runs everywhere including Monterey, I have to sign and notarize the application.
@amitjoy - I was able to get my app to run on a Mac that has no JRE, WITHOUT signing it, simply by putting the file entitlements.plist
in the same folder as my POM file, then adding this line to the mac portion of my execution:
<entitlements>entitlements.plist</entitlements>
... using version 1.6.6 of JavaPackager.
Here is entitlements.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.disable-executable-page-protection</key>
<true/>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
</dict>
</plist>
And here is what my Javapackager config looks like in my POM file:
<plugin>
<groupId>io.github.fvarrui</groupId>
<artifactId>javapackager</artifactId>
<version>1.6.6</version>
<configuration>
<mainClass>${exec.mainClass}</mainClass>
<bundleJre>true</bundleJre>
<customizedJre>false</customizedJre>
<generateInstaller>true</generateInstaller>
<administratorRequired>false</administratorRequired>
</configuration>
<executions>
<execution>
<id>windows</id>
<phase>package</phase>
<goals>
<goal>package</goal>
</goals>
<configuration>
<platform>auto</platform>
<createZipball>false</createZipball>
<createTarball>true</createTarball>
<macConfig>
<icnsFile>/Users/michael/IdeaProjects/GistFX/src/main/resources/com/redmondsims/gistfx/Assets/mac/GistFX.icns</icnsFile>
<generateDmg>true</generateDmg>
<generatePkg>false</generatePkg>
<volumeName>GistFX</volumeName>
<volumeIcon>/Users/michael/IdeaProjects/GistFX/src/main/resources/com/redmondsims/gistfx/Assets/mac/GistFX.icns</volumeIcon>
<entitlements>entitlements.plist</entitlements>
</macConfig>
</configuration>
</execution>
</executions>
</plugin>
I did have a module-info.java
file in my project, but I had to remove it to get things to work correctly, but I'm going to see if I can re-integrate it just out of curiosity to see if the size of the compiled code is any different, since that is one of the biggest selling points of modularity ... efficiency and granular control over what gets thrown into the soup ... as it were ☺
Including a module-info.java has nothing to do with JavaPackager, as it only provides strong encapsulation, so you can't access classes which are not specifically exported, being checked by the JVM at runtime. JavaPackager copies all dependencies to your app and then analyzes them using jdeps tool in order to know which core modules are required. Some dependencies are modularized, and some others aren't (those are called automatic modules), which usually causes a module not found exception. Then, with those core modules, it generates a customized and reduced JRE using jlink. That was the idea, but this dependency analysis process has to be improved, as jdeps is not working as I expected.
So, when jdeps fails or doesn't work fine, we have to include all core modules in the generated JRE, losing the possibility to bundle a reduced JRE for distribution. Or specify one by one in which core modules our app depends on, and its dependencies, and dependencies of its dependencies, and .... the same recursively (for transitive dependencies)
Branch issue-185 merged into devel (included macConfig.hardenedCodesigning
property)
@fvarrui - Are you saying that the inclusion of a module-info.java
will have no impact one way or the other on the JavaPackager process? Or are you saying that in some circumstances, it may cause it to fail or improperly build a distribution package?
Hi @EasyG0ing1! Sorry for my late reply.
Are you saying that the inclusion of a
module-info.java
will have no impact one way or the other on the JavaPackager process?
Not exactly. I think I didn't explain myself well. JavaPackager analyzes all JARs included with the app (your app JAR and all its dependencies). So, modules required in your module-info.java
are also considered when bundling a customized JRE.
Or are you saying that in some circumstances, it may cause it to fail or improperly build a distribution package?
Distribution packages are well built by JavaPackager, but the building process could fail when searching the required modules with jdeps
.
Anyway, I think that there are some things in JavaPackager which has to be improved when dealing with modules. For example, after finding required modules, all those which are not core modules should be excluded when running jlink
, since the idea is to create a reduced JRE, and keep all the libraries (both modular and non-modular) in the "libs" directory (not included in the JRE). Although perhaps another approach would be that those modular libraries to be part of the JRE and leave the non-modular libraries only in "libs". I'm woking on it!
I'm submitting a…
Short description of the issue/suggestion: Build DMG using 1.6.5 (the latest release) but the application cannot be opened after finishing DMG installation on Mac.
It works perfectly with 1.6.3 or any version before it but doesn't work with 1.6.4 and 1.6.5
Steps to reproduce the issue/enhancement:
What is the expected behavior? Clicking on the application after having it installed from the DMG file, the application opens normally
What is the current behavior? Clicking on the application after having it installed from the DMG file, the application exits unexpectedly
Do you have outputs, screenshots, demos or samples which demonstrate the problem or enhancement?
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
Other information (e.g. related issues, suggestions how to fix, links for us to have context)
If you are wondering why I am not using jpackage, there is a strong reason for it. I have been banging my head around about a month but the application after having installed from the DMG built by jpackage cannot be opened at all. It can only be opened if I start the application from command line. But it works perfectly if I use JavaPackager. That's why I had to switch to JavaPacakger once again.