Eclipse: Packaging a JAR with natives

前端 未结 1 1376
被撕碎了的回忆
被撕碎了的回忆 2020-12-18 10:17

I have made a Java game using LWJGL, which requires some native files. It all works fine in Eclipse. I want to include the .dll files inside a JAR file, but everytime I try,

相关标签:
1条回答
  • 2020-12-18 10:42

    I just ran into this a few weeks ago. Alas, I do not have links, but I found that you cannot reference native files stored inside of a jar file. You have to either programatically extract them before you reference them, or you have to install them alongside your jar file.

    I went with the second option and just have Eclipse pack the whole collection into a zip file for distribution.

    For the first option, one place to look would be the source code for JNA. They ship dll's/binaries inside their jar file and extract then on demand.

    0 讨论(0)
提交回复
热议问题