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

Alexey Semenyuk alexey.semenyuk at
Fri Feb 26 22:03:53 UTC 2021

On 2/26/2021 2:39 PM, Tobias Oelgarte wrote:
> No luck. If i put my files in 'target/image/AppName/app/' subfolder 
> they are not included in the .deb file. The entire app folder is 
> missing (even from the jpackage installer --temp directory). If i put 
> them in 'target/image/AppName/bin/' they are included and also installed.
Looks like a bug in jpackage.

> I can't file a bug report in JIRA. I would if I could, but I have no 
> access to it.
Sorry for misleading you. Please use tool to file a bug (Component: 
"Tools issues", Subcomponent: "jpackage").

> BTW is there any reliable way to figure out the path of the 'app/' 
> directory after it has been installed from within the running 
> application? In JDK 14 (Windows) I got the system property 
> 'java.launcher.path', but under JDK 16 (Ubuntu 18.04) this property is 
> missing and instead I found '' which points to the 
> binary inside 'bin/'.
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

- Alexey

> On 26.02.21 18:25, Alexey Semenyuk wrote:
>> Tobias,
>> If you put your files in 'target/image/AppName/app/' subfolder and 
>> they are missing in .deb file it is a bug in jpackage. Please go 
>> ahead and file a bug in JIRA. We will work of the fix.
>> - Alexey
>> On 2/26/2021 12:05 PM, Tobias Oelgarte wrote:
>>> I tried JDK 14.0.2 and JDK 16 Build 36. I let Maven put my extra 
>>> files into '/target/image/AppName/*/' and i also tried to put them 
>>> into 'target/image/AppName/app/*' but nothing worked. It works 
>>> perfectly for 'msi' at all places under AppName, but not for 'deb'.
>>> After some trial an error I added the files to 
>>> "target/image/AppName/bin/*" and surprisingly this worked. But this 
>>> is not really what I expected. At least the path relative to the 
>>> binary stays the same. Maybe it was intended that way?
>>> On 26.02.21 17:42, Alexey Semenyuk wrote:
>>>> Hi Tobias,
>>>> Extra files in deb packaging should work. What is the version of 
>>>> jpackage you are using? Where do you put extra files in app image? 
>>>> If you put them in the root directory of app image they will not be 
>>>> included in the package. Recommended location for extra files is 
>>>> "app" subdirectory of app image.
>>>> - Alexey
>>>> On 2/26/2021 10:58 AM, Tobias Oelgarte wrote:
>>>>> I'm creating an app image with the following commands*:
>>>>>   jlink --output runtime --module-path [..] --add-modules [..] 
>>>>> --bind-services
>>>>>   jpackage --type app-image --dest image --module [..] 
>>>>> --runtime-image runtime --name Name
>>>>> Now i copy some extra files to the resulting image, which are 
>>>>> needed during program execution.
>>>>> After that i can create an MSI installer with the following command*:
>>>>>   jpackage --type msi --dest installer --app-image image --name Name
>>>>> As the result I get an installer which also includes the extra 
>>>>> files which I added to the app-image an the extra files are 
>>>>> installed along with the rest of the image.
>>>>> But if i do the same, creating a Debian installer package (deb), 
>>>>> then the extra files are not included.
>>>>>   jpackage --type deb --dest installer --app-image image --name Name
>>>>> The resulting deb installs just fine, but the files are not 
>>>>> included in the deb archive and are obviously not written to the 
>>>>> installation directory.
>>>>> Did I miss something, or is this not possible when creating an 
>>>>> Debian package?
>>>>> * I removed some trivial parameters like --vendor, --copyright, 
>>>>> --resource-dir, e.t.c. to keep the commandlines short

More information about the jdk-dev mailing list