导出后,Runnable Jar 文件没有 运行

After export, Runnable Jar File doesnt run

在将我制作的游戏应用程序导出为 运行 可用 .jar 文件后,我从命令提示符 运行 它只是发现了一些问题。我不得不解决一些找不到音频路径和无法 read/write 进入 .txt 文件的问题。我看过并能够解决的音频,我看过并接近解决它的文件,但是在此处制作 post 之后,我了解到我所缺少的只是开头的 .我的文件名。现在只剩下一个问题了。

当我导出它时:

extract required libraries into JAR

它给了我这个例外:

Catched FileNotFoundException .... -natives-windows-i586.jar(System couldnt locate especified file) ...

Exception in thread "main" java.lang.UnsatisfiedlinkError: Cant load library: ...\gluegen-rt.dll

当我导出它时:

package required libraries into generated JAR`

它说:

Catched MalformedURLException: Could not open Inputstream for URL: 'rsrc:glugen-rt-natives-windows-i586.jar', ....

Exception in thread "main" java.lang.reflect.invocationTargetException

Caused by: java.lang.UnsatisfiedlinkError: Cant load library: ...\gluegen-rt.dll

构建路径如下所示:

Source: CubeSurvivor/src

Projects: JOGL (where glugen-rt.dll is and this project is required because it contains everything related to graphics)

Libraries: JRE System Library[JavaSE-1.8]

Order and Export:

  • CubeSurvivor/src with box filled
  • JRE System Library[JavaSE-1.8] box not filled (tried with box selected)
  • JOGL box not filled (tried with box selected)

我不明白我做错了什么,从表面上看,包含 JOGL 的项目似乎不会转到 .jar 文件,但我已经确认它是用 7-zip 打开的,但我找不到 gluegen-rt.dll (可能成千上万的文件看起来不够好)。该文件与其他 .jar 文件位于 JOGL.

上的文件夹内

可能没有将此文件复制或提取到创建的 .jar 文件中?

还是我的构建路径有问题?如果是这样,我该怎么办?

我是否应该将 JOGL 中的所有文件添加到 src 中?

编辑:

我用 7-zip 解压缩了 jar 文件到 运行 文件搜索,我做了 运行dom 搜索(在它的所有数千个文件之后)和所有除了 lib 文件夹中的那些, JOGL.iml 和引用的库,都在 JOGL 中,未找到,文件夹本身未找到。其他一切都是。

这是 JOGL 的内部结构:

JOGL Project View

lib、JOGL.iml 和引用的库显然不在 jar 文件中。

好的,这个帖子已经解决了,答案在评论里,有类似问题的朋友一定要看看哦。我不知道如何让这个线程结束,我相信版主会看到它。

所以,我只想说谢谢大家的宝贵帮助,很抱歉毕竟我没有正确使用 JOGL 是我的错误。此 link 将来可能会对其他人有所帮助,所以我将其张贴在这里。

http://jogamp.org/wiki/index.php/JogAmp_JAR_File_Handling#Eclipse