From looking through the documentation for jpackage it doesn't seem there is any examples of how to use jpackage to bundle a javascript front end with a java backend. Is this possible?
From looking through the documentation for jpackage it doesn't seem there is any examples of how to use jpackage to bundle a javascript front end with a java backend. Is this possible?
The job of jpackage is to take a Java application, bundle it with a Java Runtime, and create a native package / installer from it - NOT "to bundle a javascript front end with a java backend". So the answer to this question would be "no".
There ARE, however, ways to package a JavaScript frontend into a (Spring Boot) Java application, like this one. As you can run this "java backend and javascript frontend" app with java -jar acme-example-app/target/*.jar, you should also be able to package it with jpackage.
While the intention of JPackage is to package a Java application, there is a feature that allows you to split the job into two parts:
This has been done so you can customize the appdir if need be.
So you could start customizing the appdir by adding your frontend. As after package installation your java application is started as default, you would have to tweak something so the frontend gets started as well and starts talking to the backend. Ultimately you would also need a browser launched as well, pointing to your frontend.
All in all this would end up as a dirty hack, not giving you much advantage over conventional packing methods. So I tend to agree that your usecase is not feasible for JPackage.