ERR_LIBRARY_NOT_LOADED -> Load library error intellij

205 Views Asked by At

I am using IntelliJ IDEA 2022.1 I am trying to make a simple printer test and loaded the given printer lib to my test program .it shows no given error as syntax and is able to reach loaded library classes from inside however after running the program IDE shows me

"C:\Program Files\Java\jdk-11.0.13\bin\java.exe" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2022.1\lib\idea_rt.jar=60723:C:\Program Files\JetBrains\IntelliJ IDEA 2022.1\bin" -Dfile.encoding=UTF-8 -classpath "C:\Users\bmbil\Desktop\CARGO\printer\wetransfer_tg2460__prtc60_100_step-zip_2022-09-09_1215\01sw0000000536_103\CuCustomWndAPI Pack 1.03\Examples\Java Library\Source code\DemoCuCustomWndAPIWrap\out\production\DemoCuCustomWndAPIWrap;C:\Users\bmbil\Desktop\CARGO\printer\wetransfer_tg2460__prtc60_100_step-zip_2022-09-09_1215\01sw0000000536_103\CuCustomWndAPI Pack 1.03\Library\Java Library\CuCustomWndAPIJWrap.jar" com.custom.democucustomwndapijwrap.main

EXCEPTION: CuCustomWndAPIWrapException Error:ERR_LIBRARY_NOT_LOADED > -> Load library error

enter image description here

My program complied with java.11, given Lib, seems compiled at bycode version 49.0 . Is there any relevance to that?

I have already tried change ide compiler support version, load library as dependency.

1

There are 1 best solutions below

0
Luka Galjot On

Move the CuCustomWndAPI.dll to the root of the project.

OR

Set the run configuration to run from the output folder.
For example I had by default:
C:\Users\xxxxx\IdeaProjects\TestTG2480H
Then I have set it to:
C:\Users\xxxxx\IdeaProjects\TestTG2480H\out\production\TestTG2480H
After that, the program works.

Explanation: The library from CUSTOM expects to have .dll present in current directory where program is ran.