jpackage does not include extra files from app-image when creating Debian package?

Tobias Oelgarte tobias.oelgarte at gmail.com
Sat Feb 27 17:05:00 UTC 2021


This works. Thank you very much.

Sadly i have to copy the files to different image app folder locations, 
depending on the operating system. Under Windows it is 
'image/AppName/app/' and under Linux it is 'image/AppName/lib/app'. 
Would have been nice if all images would have the same directory 
structure. This way i have to create OS specific maven profiles.

On 27.02.21 14:42, Andy Herrick wrote:
> If you want to find the app dir directly on all platforms, use a 
> command line option as Michael does in HalfPipe, except directly:
>
> --java-options -Djpackage.app.dir='$APPDIR'
>
> this $APPDIR will be expanded when jli is invoked to point to the 
> applications app dir. ($BINDIR, and $ROOTDIR can be used in similar ways)
>
> /Andy
>
> On 2/27/2021 6:51 AM, Tobias Oelgarte wrote:
>> On 27.02.21 11:22, Michael Hall wrote:
>>>
>>>> On Feb 27, 2021, at 1:31 AM, Tobias Oelgarte 
>>>> <tobias.oelgarte at gmail.com> wrote:
>>>>
>>>>> No, there is no platform independent and reliable way to get the 
>>>>> path to 'app' directory. However you can get location of one of 
>>>>> your app's classes through Class.getResource(). See 
>>>>> https://stackoverflow.com/questions/227486/find-where-java-class-is-loaded-from 
>>>>> <https://stackoverflow.com/questions/227486/find-where-java-class-is-loaded-from> 
>>>>>
>>>> That isn't helpful at all. All i get is either the URL 
>>>> jrt:/<modulename> or null, but not the installation directory or 
>>>> something similar.
>>> System property? java.home, java.launcher.path, java.library.path, 
>>> java.class.path
>>>
>>> My application indicates a security policy…
>>> -Djava.security.policy=$APPDIR/all.policy
>>>
>>> Which actually gets you into the app directory.
>>> -Djava.security.policy=$APPDIR/all.policy
>>>
>>> On virtual box Windows showing...
>>> C:\Program Files\HalfPipe\app/all.policy
>>
>> java.home points to the runtime directory, which is fine, but it is 
>> placed differently on Windows and Linux. In Windows it is 
>> 'AppName/runtime' with app directory 'AppName/app' and under Linux it 
>> is 'AppName/lib/runtime' with app directory 'AppName/app'. So i have 
>> to query the operating system first, before deciding where the 'app' 
>> directory would be. Additionally i can't create a *.deb including the 
>> app folder, because jpackage fails to include the app directory.
>>
>> java.launcher.path is not available under Linux with JDK 16. Instead 
>> i would have to use jpackage.app-path.
>>
>> java.library.path is a list of paths pointing outside of the 
>> application directory. For example: 
>> '/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib'
>>
>> java.class.path is empty in case of a modular application.
>>
>> Using a security policy file is also an awkward way, to only get the 
>> app directory. But at least it is doable.
>>


More information about the jdk-dev mailing list