Hi Core-libs-dev,

I’m trying to report an issue with JPackage on recent versions of OSX.

Problem is, the microphone permissions aren’t granted to applications created 
by jpackage. The resulting recorded 16 bit PCM line in samples files are the 
correct duration, but don’t have any sound (samples all set to 0).

System Preferences -> Security & Privacy -> Privacy -> Microphone
(application never asks for permissions)

Otherwise, the only workaround I can figure out is to have the app launch then 
bootstrap itself using Runtime and grant applications to the Terminal.app (when 
it calls itself from `java Application.app/MacOS/Resources/Application`)

There are various reports of this on the Internet - but I’m wondering if the 
JPackage team is aware of the issue.

https://stackoverflow.com/questions/55727488/application-doesnt-ask-for-permission-to-access-microphone-in-macos-10-14-mojav

This pretty much shows the solution - needs a bit of Objective C though.

Reproducing the problem: JPackage any java sound recording app on latest OSX, 
run it... will be unable to capture sound. Run the same code from the command 
line, via classpath or modules... it will record audio after asking the user to 
grant microphone permissions to Terminal.app.

It would be great if this is fixed in JDK 17.


Many Thanks,


Ben S

Reply via email to