How to get the path to the executable when using launch4j?

前端 未结 5 1528
时光取名叫无心
时光取名叫无心 2020-12-17 22:46

I\'m using launch4j to wrap an executable jar file in my Windows application, but I need to pass references to some of its libraries in through the JVM arguments. The librar

5条回答
  •  鱼传尺愫
    2020-12-17 23:03

    Set -Djna.library.path= (if using JNA) and -Djava.library.path=.

    Alternatively, this can be done in Java code as: System.setProperty("jna.library.path","") and System.setProperty("java.library.path",""). You can append as many paths to refer to. In Windows, use ; to separate the paths.

    This setup only has its effect on the JVM runtime of that Java application (not globally like LD_LIBRARY_PATH in Linux.)

    Or, you can put this in Launch4J JVM options list under JRE tab. This is what I do in my projects.

提交回复
热议问题