0

I am done developing an application that has POS device integrated. This device communicates through Javapos libs and also some dll(the dlls are placed outside the src) plus a jpos.xml placed just inside the src. When the app is executed on the netbeans it works alright with the device, but not when I execute it outside the NetBeans. This is a JavaFX app based on jdk-8. Because of this I just cannot create an installable since the device needs to work with the app. The following is the preview of the directory;

enter image description here

The app project runs smoothly in NetBeans 12.6 smoothly. But when I even try to run it directly from the created dist folder, everything works except the POS device. So Long as it can run within the project convinces me that I can do something to make it work outside NetBeans, but how????

What am I missing. Need help to resolve this.

Andrés Alcarraz
  • 1,570
  • 1
  • 12
  • 21
Kwesi Aryee
  • 310
  • 2
  • 15
  • Perhaps you need to [set the library path](https://stackoverflow.com/questions/1734207/how-to-set-java-library-path-for-processing/15587531.) – jewelsea Feb 08 '22 at 20:25
  • The JposPrinterJIOx32.dll/64.dll has to be out of the src for it to work. There is something linking those 2 files to the app. In addition, there are jpos libs in the lib directory. My Question is, what is linking those 2 files t the app and how can I manage it so that I can execute the code outside the ide - netbeans. – Kwesi Aryee Feb 08 '22 at 21:59
  • They are dlls, they are [dynamically linked libraries](https://stackoverflow.com/questions/484452/what-is-a-dll). They are linked by the OS. It doesn't matter where they are as long as they are on the library path which you provide to the `java` process via the `-Djava.library.path` option. The OS will link the libraries dynamically at runtime and make them accessible to the `java` process when the [loadLibrary](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/System.html#loadLibrary(java.lang.String)) method is called. – jewelsea Feb 08 '22 at 22:10
  • Finally i had to put the dlls just outside the dist folder for me to successfully use the device that used the dll. – Kwesi Aryee May 08 '22 at 09:46

0 Answers0