简体   繁体   中英

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. I've had to solve some issues with not finding audio path and not being able to read/write into .txt files. 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

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`

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

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)

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). That file along with other .jar files are located inside a folder on JOGL .

Maybe this file isn't being copied or extracted to the .jar file created?

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 ?

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. Everything else was.

Heres what the inside of JOGL looks like:

JOGL Project View

lib, JOGL.iml and referenced libraries are not in the jar file aparently.

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. This link might help others in the future so im posting it here.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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