简体   繁体   English

导出后,可运行的Jar文件无法运行

[英]After export, Runnable Jar File doesnt run

After exporting a game app I'm making as a runnable .jar file, I ran it from the command prompt only to find some issues. 将我正在制作的游戏应用程序导出为可运行的.jar文件后,我从命令提示符处运行了它,只是发现了一些问题。 I've had to solve some issues with not finding audio path and not being able to read/write into .txt files. 我不得不解决一些问题,找不到音频路径,也无法读取/写入.txt文件。 Audio I've looked and was able to solve, the files one I looked and came to close to solving it but after making a post here I learned all I was missing was a . 我看过并能够解决的音频文件,我看过并接近解决的文件,但是在这里发表文章后,我得知我所缺少的只是一个. at the start of my fileNames. 在我的文件名开头。 Now there's only one problem left. 现在只剩下一个问题。

When I export it with: 当我导出时:

extract required libraries into JAR 将所需的库提取到JAR中

it gives me this exception: 它给了我这个例外:

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

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

When I export it with: 当我导出时:

package required libraries into generated JAR` 将所需的库打包到生成的JAR中

it says: 它说:

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

The build path looks something like this: 构建路径如下所示:

Source: CubeSurvivor/src 资料来源: CubeSurvivor/src

Projects: JOGL (where glugen-rt.dll is and this project is required because it contains everything related to graphics) 项目: JOGL glugen-rt.dll在其中,并且此项目是必需的,因为它包含与图形有关的所有内容)

Libraries: JRE System Library[JavaSE-1.8] 库: JRE System Library[JavaSE-1.8]

Order and Export: 订购和出口:

  • CubeSurvivor/src with box filled 带盒子的CubeSurvivor/src
  • JRE System Library[JavaSE-1.8] box not filled (tried with box selected) JRE System Library[JavaSE-1.8]框未填写(尝试选择框)
  • JOGL box not filled (tried with box selected) JOGL框未填充(尝试选择框)

I dont understand what I'm doing wrong, from the looks of it, it seems maybe the project containing JOGL isn't going to the .jar file but I've confirmed that it is while opening with 7-zip but I couldn't find gluegen-rt.dll (maybe haven't looked well enough its thousands upon thousands of files). 我不明白我在做什么错,从外观JOGL ,似乎包含JOGL的项目不会进入.jar文件,但我已经确认它是使用7-zip打开的,但我无法找不到gluegen-rt.dll (也许看起来还不够好,成千上万个文件)。 That file along with other .jar files are located inside a folder on JOGL . 该文件以及其他.jar文件位于JOGL上的文件夹内。

Maybe this file isn't being copied or extracted to the .jar file created? 也许此文件没有被复制或提取到创建的.jar文件中?

Or is there something wrong with my build path? 还是我的构建路径有问题? If so, what should I do? 如果是这样,我该怎么办?

Should I add all the files inside JOGL to the src ? 我应该将JOGL中的所有文件添加到src吗?

Edit: 编辑:

I extracted the jar file with 7-zip to run a file search, I made random searches(after all its thousands of files) and all except those in a folder called lib, JOGL.iml and referenced libraries, all inside JOGL, were not found, the folder itself was not found. 我用7-zip提取了jar文件以运行文件搜索,我进行了随机搜索(查找了成千上万个文件之后),而所有文件(除lib,JOGL.iml和引用的库中的所有文件)均在JOGL内,不是找到该文件夹​​本身。 Everything else was. 其他一切都是。

Heres what the inside of JOGL looks like: 以下是JOGL的内部外观:

JOGL Project View JOGL专案检视

lib, JOGL.iml and referenced libraries are not in the jar file aparently. lib,JOGL.iml和引用的库显然不在jar文件中。

Ok so this thread has been resolved, the answers are in the comments, so if anyone encounters a similar issue be sure to check it. 好的,因此该线程已解决,答案在注释中,因此,如果有人遇到类似问题,请务必进行检查。 I dont know how to make this thread end, im sure a moderator will see it. 我不知道如何使该线程结束,请确保主持人会看到它。

So, i just wanted to say thank you all for your precious help and sorry after all it was my mistake not using JOGL properly. 因此,我只想说谢谢大家的宝贵帮助,对不起,毕竟这是我没有正确使用JOGL的错误。 This link might help others in the future so im posting it here. 该链接将来可能会对其他人有所帮助,因此请在此处发布。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM