I have a Java application that uses the Java sound API to record sound from the systems microphone. When run on macOS from the terminal, sound recording works as expected, but no sound is recorded when the app is packaged using install4j.
I am using Liberica JDK 17 as the runtime.
In Install4J, I use an entitlements file like this.
<?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.device.audio-input</key>
<true/>
<key>com.apple.security.device.microphone</key>
<true/>
</dict>
</plist>
When run from Terminal using java -jar, the app requests microphone access. When packaged and run via Install4, there is no request for a permission.
The app is properly signed / notarized with a certificate.
Any ideas what I might be missing?
Thanks!