jpackage: support for environment variables in --java-options

Scott Palmer swpalmer at gmail.com
Thu Sep 3 03:07:34 UTC 2020


There is already a way to supply a custom Info.plist.  
That can have the LSEnvironment entries you want.

https://bugs.openjdk.java.net/browse/JDK-8233175 <https://bugs.openjdk.java.net/browse/JDK-8233175>

I was under the impression that we were after something that would allow different values to get to the application based on environment variables.  The env var values can’t be hard-coded in the Info.plist to do that, we want values that are expanded based on set environment variables on the user’s machine.  Isn’t that what this is about?

Scott


> On Sep 2, 2020, at 1:20 PM, Michael Hall <mik3hall at gmail.com> wrote:
> 
> 
> 
>> On Sep 2, 2020, at 12:14 PM, Scott Palmer <swpalmer at gmail.com> wrote:
>> 
>> If your app need to use environment variables to configure something for runtime it is probably best to have your own stub launcher and launch a sub-process.  
> 
> They need to be available at runtime for external native that expects them to be present. 
> 
>> 
>> It can be tricky to have a smooth user experience with that though. You would want to avoid an extra icon in the dock/start bar. You don’t want the other process to show up as “java.exe”, etc.  That’s the benefit of trying to solve this in the launcher created by jpackage. 
>> 
> 
> What I am suggesting would be handled by jpackage within the application bundle. It would modify the Info.plist to include the LSEnvironment entries.



More information about the core-libs-dev mailing list