1

I am developing a javafx application. This app communicates with a device and because of that the device jars are not modular and they come with some dll files that are added to the development. Now, it runs perfect on the Netbeans 12.6, but not when I create the installer with the jdk-17 jpackage. I believe I am missing something, but since I am quite new to this jpackage I just don't know how to get it resolved. The following is the structure of the app.

enter image description here

I want to try running this on the terminal just to see whether it will execute well. What I am getting from the netbeans ant is to try the following;

Blockquote C:\Program Files\Java\jdk-17.0.2/bin/java -p C:\Projects\My\App\v3\application-name\dist\application-name.jar;C:\Projects\AntLibrary\controlfx\controlsfx-11.1.1.jar;C:\Users\Kwesi Aryee.m2\repository\net\minidev\json-smart\2.4.7\json-smart-2.4.7.jar;C:\Projects\AntLibrary\commons-lang3-3.12.0\commons-lang3-3.12.0.jar;C:\Users\Kwesi Aryee.m2\repository\commons-dbutils\commons-dbutils\1.7\commons-dbutils-1.7.jar;C:\Users\Kwesi Aryee.m2\repository\commons-io\commons-io\2.11.0\commons-io-2.11.0.jar;C:\Users\Kwesi Aryee.m2\repository\org\codehaus\jackson\jackson-mapper-asl\1.9.13\jackson-mapper-asl-1.9.13.jar;C:\Users\Kwesi Aryee.m2\repository\commons-validator\commons-validator\1.7\commons-validator-1.7.jar;C:\Users\Kwesi Aryee.m2\repository\org\hsqldb\hsqldb\2.6.0\hsqldb-2.6.0.jar;C:\Projects\AntLibrary\commons-text-1.9\commons-text-1.9.jar;C:\Users\Kwesi Aryee.m2\repository\com\fasterxml\uuid\java-uuid-generator\4.0.1\java-uuid-generator-4.0.1.jar;C:\Users\Kwesi Aryee.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.13.0\jackson-annotations-2.13.0.jar;C:\Users\Kwesi Aryee.m2\repository\com\fasterxml\jackson\core\jackson-core\2.13.0\jackson-core-2.13.0.jar;C:\Users\Kwesi Aryee.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.13.0\jackson-databind-2.13.0.jar;C:\Users\Kwesi Aryee.m2\repository\com\fasterxml\jackson\dataformat\jackson-dataformat-csv\2.8.8\jackson-dataformat-csv-2.8.8.jar;C:\Projects\AntLibrary\activation-1.1.1.jar;C:\Users\Kwesi Aryee.m2\repository\io\github\palexdev\materialfx\11.12.0\materialfx-11.12.0.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jaxrs-2.1\jakarta.ws.rs-api-2.1.6.jar;C:\Projects\AntLibrary\gson\gson-2.8.9.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\ext\jakarta.annotation-api-1.3.5.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\ext\jakarta.persistence-api-2.2.3.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\ext\jakarta.servlet-api-4.0.4.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\ext\jakarta.validation-api-2.0.2.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\ext\jakarta.xml.bind-api-2.3.3.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\jersey-client.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\jersey-common.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\jersey-server.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\ext\jersey-entity-filtering-2.34.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\ext\jersey-hk2-2.34.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\ext\jersey-media-moxy-2.34.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\jersey-container-servlet.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\jersey-container-servlet-core.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\ext\hk2-api-2.6.1.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\ext\hk2-locator-2.6.1.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\ext\hk2-utils-2.6.1.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\ext\jakarta.inject-2.6.1.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\ext\aopalliance-repackaged-2.6.1.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\ext\osgi.core-8.0.0.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\ext\osgi-resource-locator-1.0.3.jar;C:\Program Files\NetBeans-12.6\netbeans\java\modules\ext\eclipselink\org.eclipse.persistence.core-2.7.9.jar;C:\Program Files\NetBeans-12.6\netbeans\java\modules\ext\eclipselink\org.eclipse.persistence.asm-9.1.0.jar;C:\Program Files\NetBeans-12.6\netbeans\java\modules\ext\eclipselink\org.eclipse.persistence.antlr-2.7.9.jar;C:\Program Files\NetBeans-12.6\netbeans\java\modules\ext\eclipselink\org.eclipse.persistence.jpa-2.7.9.jar;C:\Program Files\NetBeans-12.6\netbeans\java\modules\ext\eclipselink\org.eclipse.persistence.jpa.jpql-2.7.9.jar;C:\Program Files\NetBeans-12.6\netbeans\java\modules\ext\eclipselink\org.eclipse.persistence.moxy-2.7.9.jar;C:\Projects\AntLibrary\javafx-sdk-17.0.1\lib\javafx.base.jar;C:\Projects\AntLibrary\javafx-sdk-17.0.1\lib\javafx.controls.jar;C:\Projects\AntLibrary\javafx-sdk-17.0.1\lib\javafx.graphics.jar;C:\Projects\AntLibrary\javafx-sdk-17.0.1\lib\javafx.fxml.jar;C:\Projects\AntLibrary\slf4j\slf4j-api-1.7.35.jar;C:\Projects\AntLibrary\reactfx\reactfx-2.0-M5.jar;C:\Projects\AntLibrary\ikonli\ikonli-core-12.3.0.jar;C:\Projects\AntLibrary\ikonli\ikonli-javafx-12.3.0.jar;C:\Projects\AntLibrary\ikonli\ikonli-materialdesign2-pack-12.3.0.jar;C:\Projects\AntLibrary\ikonli\ikonli-fontawesome5-pack-12.3.0.jar;C:\Projects\AntLibrary\ikonli\ikonli-bootstrapicons-pack-12.3.0.jar;C:\Projects\AntLibrary\zywell_javaPos\JposPrinterJavaPOS.jar;C:\Projects\AntLibrary\zywell_javaPos\jcl.jar;C:\Projects\AntLibrary\zywell_javaPos\jpos113-controls.jar;C:\Projects\AntLibrary\jakarta.activation-api-2.0.1.jar -cp C:\Projects\AntLibrary\controlfx\controlsfx-11.1.1.jar;C:\Users\Kwesi Aryee.m2\repository\net\minidev\json-smart\2.4.7\json-smart-2.4.7.jar;C:\Users\Kwesi Aryee.m2\repository\commons-dbutils\commons-dbutils\1.7\commons-dbutils-1.7.jar;C:\Users\Kwesi Aryee.m2\repository\org\hsqldb\hsqldb\2.6.0\hsqldb-2.6.0.jar;C:\Users\Kwesi Aryee.m2\repository\commons-validator\commons-validator\1.7\commons-validator-1.7.jar;C:\Users\Kwesi Aryee.m2\repository\com\fasterxml\uuid\java-uuid-generator\4.0.1\java-uuid-generator-4.0.1.jar;C:\Projects\AntLibrary\commons-lang3-3.12.0\commons-lang3-3.12.0.jar;C:\Users\Kwesi Aryee.m2\repository\io\github\palexdev\materialfx\11.12.0\materialfx-11.12.0.jar;C:\Users\Kwesi Aryee.m2\repository\commons-io\commons-io\2.11.0\commons-io-2.11.0.jar;C:\Projects\AntLibrary\commons-text-1.9\commons-text-1.9.jar;C:\Users\Kwesi Aryee.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.13.0\jackson-annotations-2.13.0.jar;C:\Users\Kwesi Aryee.m2\repository\com\fasterxml\jackson\core\jackson-core\2.13.0\jackson-core-2.13.0.jar;C:\Users\Kwesi Aryee.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.13.0\jackson-databind-2.13.0.jar;C:\Users\Kwesi Aryee.m2\repository\com\fasterxml\jackson\dataformat\jackson-dataformat-csv\2.8.8\jackson-dataformat-csv-2.8.8.jar;C:\Projects\AntLibrary\gson\gson-2.8.9.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jaxrs-2.1\jakarta.ws.rs-api-2.1.6.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\ext\jakarta.annotation-api-1.3.5.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\ext\jakarta.persistence-api-2.2.3.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\ext\jakarta.servlet-api-4.0.4.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\ext\jakarta.validation-api-2.0.2.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\ext\jakarta.xml.bind-api-2.3.3.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\jersey-client.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\jersey-common.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\jersey-server.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\ext\jersey-entity-filtering-2.34.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\ext\jersey-hk2-2.34.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\ext\jersey-media-moxy-2.34.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\jersey-container-servlet.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\jersey-container-servlet-core.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\ext\hk2-api-2.6.1.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\ext\hk2-locator-2.6.1.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\ext\hk2-utils-2.6.1.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\ext\jakarta.inject-2.6.1.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\ext\aopalliance-repackaged-2.6.1.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\ext\osgi.core-8.0.0.jar;C:\Program Files\NetBeans-12.6\netbeans\enterprise\modules\ext\jersey2\ext\osgi-resource-locator-1.0.3.jar;C:\Program Files\NetBeans-12.6\netbeans\java\modules\ext\eclipselink\org.eclipse.persistence.core-2.7.9.jar;C:\Program Files\NetBeans-12.6\netbeans\java\modules\ext\eclipselink\org.eclipse.persistence.asm-9.1.0.jar;C:\Program Files\NetBeans-12.6\netbeans\java\modules\ext\eclipselink\org.eclipse.persistence.antlr-2.7.9.jar;C:\Program Files\NetBeans-12.6\netbeans\java\modules\ext\eclipselink\org.eclipse.persistence.jpa-2.7.9.jar;C:\Program Files\NetBeans-12.6\netbeans\java\modules\ext\eclipselink\org.eclipse.persistence.jpa.jpql-2.7.9.jar;C:\Program Files\NetBeans-12.6\netbeans\java\modules\ext\eclipselink\org.eclipse.persistence.moxy-2.7.9.jar;C:\Projects\AntLibrary\zywell_javaPos\JposPrinterJavaPOS.jar;C:\Projects\AntLibrary\zywell_javaPos\jcl.jar;C:\Projects\AntLibrary\zywell_javaPos\jpos113-controls.jar; -m com.klarysoft.retail Blockquote

But then I am getting error with this. Any ideas, I know I am not doing something right. Please I will appreciate any help.

Kwesi Aryee
  • 310
  • 2
  • 15
  • I've never had to do this, and I'm not sure if it solves your problem, but you can create a jmod which includes native libraries using the `jmod` tool. See https://docs.oracle.com/javase/9/tools/jmod.htm – James_D Feb 02 '22 at 15:28
  • Not sure on how to do this, but will look at how I can do that, however, I already have jmods included "--module-path "C:\Program Files\Java\javafx-jmods-17.0.2" \" in the jpackage cmd. – Kwesi Aryee Feb 02 '22 at 16:06
  • 2
    You need to help us to help you by putting the details of what you've tried and failed with. There are so many reasons why it won't work - for example see other jpackage questions in SO such as [this answer which links to a few common issues](https://stackoverflow.com/questions/70456027/java-fx-application-with-jpackage-not-work/70460422#70460422). – DuncG Feb 02 '22 at 16:11
  • 1
    I meant that you may need/want to *create* a jmod to include in the runtime you create with `jpackage` (as well as using the existing JavaFX jmods). – James_D Feb 02 '22 at 16:21
  • You may be interested in knowing [what a jmod is and how it differs from a jar](https://stackoverflow.com/questions/44732915/why-did-java-9-introduce-the-jmod-file-format). Perhaps you could package your module as a jmod which includes the native libs. Or, perhaps just as a jar with the native libs included as separate resources that you place on the Java native library path using a system property you add to your launch script. – jewelsea Feb 03 '22 at 00:01
  • Yes, I think so and I have to learn how to do this, I'm hoping that the learning curve will not kill my schedule. – Kwesi Aryee Feb 03 '22 at 06:31
  • You don't need to make your jars into modules. you just need to ensure your jars + native code libraries are packaged under the `app` directory, then they should be accessible after installation. – DuncG Feb 03 '22 at 09:47

1 Answers1

0

Have a look here: https://github.com/dlemmermann/JPackageScriptFX The non-modular approach to use jlink/jpackage described there will also work in your case. I use it, e.g., to include SQLight-JDBC which also includes native libraries.

mipa
  • 10,369
  • 2
  • 16
  • 35