Import libreries .jar in mendix

0
Hello everyone, I have had some problems related to mendix in the last few days. The problem is in an implementation, we need to import some libraries (.js) provided by the software developers. For which I have been using a JavaScript action, but it is not able to recognize the library. We do not know what could cause the error and any comments from us would be of great help. Or if you have any example, it would also be of great help to me. Attached are screenshots of how the code is implemented and the path where the libraries are placed. This ticket includes a secure attachment. Use this link to access the attached files:
asked
4 answers
1

Im not sure I understand, if you need to use .jar library files you should make a java-action not a javascript-action. You can add the .jar files to the userlib folder of your mendix project and then you can use imports at the top of your java-action to access the needed classes contained in the jar files. 

 

btw the link doesnt work.

answered
0

You can use npm to install the packages you need in your actions directory so you can reference them in your javascript actions

answered
0

To give a little more detail of the case, what is specifically sought is to use a portable printer through mendix, for which a library provided by the company must be used (You can see in the image). In addition to the above, you already have this https://sat.siemens-energy.cloud/lib/ZebraPrinter/js/BrowserPrint-Zebra-1.1.250.min.js in which you can find the .js file. I am very grateful for any help.

answered
0

For example, the element-ui I mentioned here, if your js is not in npm, you can add a package.json configuration information like this (note that js needs to be modular)

image.png

image.png

answered