finnkuusisto / TinySound

Simple library for playing sounds and music in Java
http://finnkuusisto.github.com/TinySound
BSD 2-Clause "Simplified" License
100 stars 27 forks source link

Exporting a Slick2D project with TinySound into a big jar. #15

Closed G0dC0der closed 10 years ago

G0dC0der commented 10 years ago

I am following this tutorial on how to export a Slick2D project into a single launchable jar file:

http://www.youtube.com/watch?v=K6K2d6LGvu8

Instead of including slick2d/jogg-0.0.7.jar and jorbis-0.0.15.jar do I include tinysound/jorbis-0.0.17.jar.

The games executes just fine but crashes when reading an ogg file. saying that the format is not supported.

Reading ogg files when running my project directly from eclipse works just fine.

The list of all the jar files I have included in the big jar:

Note that this is not a bug report, I just need some help :)

finnkuusisto commented 10 years ago

I'm not familiar with JarSplice, so it's a little difficult for me to say. I tried to do the same with just the TinySoundExample file, but I'm getting the same problem. The contents of the jar file appear as if they are setup correctly. I did notice that JarSplice inserts its own launcher class as the main class in the runnable jar, so perhaps it's not handling the classpath correctly somehow as a result of that.

I did find, however, that if I just exported from Eclipse by creating a "Runnable JAR file", selecting my main class for the launch configuration, and selecting the "Extract required libraries into generated JAR" option, it worked just fine.

G0dC0der commented 10 years ago

Thanks, that worked. It also works if I export the project into an exe file with jarSplice.