javadebjpackage

jpackage - missing .jpackage.xml file


I am an amateur so may not have the terminology correct! I have followed instructions from a textbook to produce a modular, stripped down jre from a database application which uses a postgresql remote datbase and jdbc postgresql driver. I followed the steps using jar, jmod, jdeps and jlink, and now have a release folder which contains a bin folder which contains a 'script shell' from which I can launch the application. My textbook details the final step (to produce .deb package) as (from the folder directly above the release folder):

jpackage --name MyInstaller --app-image ./release/

I get the following error:

Error: Missing .jpackage.xml file in app-image dir "./release"

I have googled but have come up with nothing that solves it, although I did find a self-answered post on this site wherein the user did track down such an .xml file (but I can't find such a file anywhere).

I am running an Ubuntu 20.04 Virtualbox VM and openjdk 20.0.2 (according to java -version).


Solution

  • Essentially the problem is that there's not nearly enough info to complete the task. Here's an (already pretty minimal) example that works for me:

    jpackage \
    --dest /tmp/xcode/jpackage \
    --type app-image \
    --app-version '1.0' \
    --copyright 'Copyright' \
    --description 'Description' \
    --name 'appname' \
    --vendor 'Vendor' \
    --runtime-image /tmp/xcode/jlink/runtime-image \
    --module-path target/classes \
    --module com.technojeeves.xcode/com.technojeeves.xcode.XCode \
    --arguments '--opt' \
    --java-options '-Dfile.encoding=UTF-8 -Xms256m -Xmx512m' \
    --type deb
    

    Probably best saved as a shell script that you can tweak