How to copy files out of the currently running jar

后端 未结 3 2167
鱼传尺愫
鱼传尺愫 2020-12-01 22:38

I have a .jar that has two .dll files that it is dependent on. I would like to know if there is any way for me to copy these files from within the .jar to a users temp folde

3条回答
  •  天涯浪人
    2020-12-01 23:19

    Use myClass.getClassLoader().getResourceAsStream("loadAtRuntime.dll"); and you will be able to find and copy DLLs in the JAR. You should pick a class which will also be in the same JAR.

提交回复
热议问题