Slick Forums

Discuss the Slick 2D Library
It is currently Tue Oct 15, 2019 2:00 am

All times are UTC




Post new topic Reply to topic  [ 41 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject:
PostPosted: Mon Aug 01, 2011 1:01 am 
Offline

Joined: Wed Jul 27, 2011 9:21 pm
Posts: 7
This tool is excellent, exactly what I've been looking for!

If it had support to output a Windows EXE file I wouldn't need anything else, I use this along with Launch4J and a bundled JRE to create dependency free Windows executables.

Just curious, will this work with an obfuscated jar?

Thanks again, this tool is a lifesaver. :D


Top
 Profile  
 
 Post subject: Invalid or corrupt jar?
PostPosted: Wed Aug 17, 2011 6:31 pm 
Offline

Joined: Wed Aug 17, 2011 6:27 pm
Posts: 1
I don't know what I'm doing wrong here. Do I use the executable jar my IDE makes for me?

When putting in the main class, do I strictly put in the packagename.classname? Or do I need a path to the file?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 18, 2011 10:01 am 
Offline
Game Developer
User avatar

Joined: Sun Nov 12, 2006 8:40 pm
Posts: 585
Just keep in mind that in order for your Slick2D application to run you need slick.jar, lwjgl.jar and the native files. Your IDE will usually only export your project and resources to a jar, you then use something like the above tool (JarSplice) to merge slick.jar, lwjgl.jar and natives with it.


Top
 Profile  
 
PostPosted: Sun Jul 01, 2012 2:44 pm 
Offline
Slick Zombie

Joined: Wed Apr 02, 2008 1:32 pm
Posts: 1340
Location: Italy
Note: I've sticky that topic

_________________
Blog | Last game Drone Swarm


Top
 Profile  
 
PostPosted: Sun Jul 01, 2012 2:52 pm 
Offline
Game Developer
User avatar

Joined: Sun Nov 12, 2006 8:40 pm
Posts: 585
Cool.

Also by way of update, JarSplice now in addition to creating executable jars has the ability create platform specific executables (*.exe for Windows, *.app for OS X and *.sh shellscript for Linux).


Top
 Profile  
 
PostPosted: Mon Jul 02, 2012 7:29 am 
Offline
Slick Zombie

Joined: Wed Apr 02, 2008 1:32 pm
Posts: 1340
Location: Italy
wow, this is cool!

_________________
Blog | Last game Drone Swarm


Top
 Profile  
 
PostPosted: Tue Jul 03, 2012 3:19 am 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1482
kappa wrote:
Cool.

Also by way of update, JarSplice now in addition to creating executable jars has the ability create platform specific executables (*.exe for Windows, *.app for OS X and *.sh shellscript for Linux).

nice.


Top
 Profile  
 
PostPosted: Thu Aug 16, 2012 9:48 pm 
Offline

Joined: Sat Aug 11, 2012 2:07 am
Posts: 18
When ever I try to open the jar or .exe, it opens, and the closes right after.
When I run it in the cmd, I get the error "unable to access jarfile"
Where did I go wrong?


Top
 Profile  
 
PostPosted: Tue Aug 21, 2012 7:20 am 
Offline

Joined: Wed Feb 29, 2012 7:07 pm
Posts: 9
Oh thank goodness. I'm not the only one experiencing this problem. I think it may be how I'm exporting my project into a runnable jar. Do you just export the project as a plain jar file?


Top
 Profile  
 
PostPosted: Tue Aug 21, 2012 9:07 am 
Offline
Game Developer
User avatar

Joined: Sun Nov 12, 2006 8:40 pm
Posts: 585
CNIAngel wrote:
Oh thank goodness. I'm not the only one experiencing this problem. I think it may be how I'm exporting my project into a runnable jar. Do you just export the project as a plain jar file?

export as plain jar.


Top
 Profile  
 
PostPosted: Tue Aug 21, 2012 10:49 am 
Offline

Joined: Wed Feb 29, 2012 7:07 pm
Posts: 9
kappa wrote:
CNIAngel wrote:
Oh thank goodness. I'm not the only one experiencing this problem. I think it may be how I'm exporting my project into a runnable jar. Do you just export the project as a plain jar file?

export as plain jar.


Alright I export my project as a plain jar, exporting the main class files and resources inside the jar. I also have all my natives and jars in a separate folder. I go through the whole process of adding the plain jar and the lib jars (lwjgl, slick2d, and marteengine), adding the natives, and pointing it toward the main class. Finally I export the fat jar. I run it. It stays up for about 7-8 seconds more then before, but still closes.

I'm not quite sure what I'm missing that's making it do this.


Top
 Profile  
 
PostPosted: Tue Aug 21, 2012 1:57 pm 
Offline
Game Developer
User avatar

Joined: Sun Nov 12, 2006 8:40 pm
Posts: 585
CNIAngel wrote:
Alright I export my project as a plain jar, exporting the main class files and resources inside the jar. I also have all my natives and jars in a separate folder. I go through the whole process of adding the plain jar and the lib jars (lwjgl, slick2d, and marteengine), adding the natives, and pointing it toward the main class. Finally I export the fat jar. I run it. It stays up for about 7-8 seconds more then before, but still closes.

I'm not quite sure what I'm missing that's making it do this.

If it gets that far that means its working but there is some runtime error with the application, you should run it on the cmd prompt and grab the exception that is thrown to get an idea on why its failing, you can run it on the command prompt by using "java -jar yourjarname.jar"


Top
 Profile  
 
PostPosted: Tue Aug 21, 2012 6:23 pm 
Offline

Joined: Wed Feb 29, 2012 7:07 pm
Posts: 9
kappa wrote:
CNIAngel wrote:
Alright I export my project as a plain jar, exporting the main class files and resources inside the jar. I also have all my natives and jars in a separate folder. I go through the whole process of adding the plain jar and the lib jars (lwjgl, slick2d, and marteengine), adding the natives, and pointing it toward the main class. Finally I export the fat jar. I run it. It stays up for about 7-8 seconds more then before, but still closes.

I'm not quite sure what I'm missing that's making it do this.

If it gets that far that means its working but there is some runtime error with the application, you should run it on the cmd prompt and grab the exception that is thrown to get an idea on why its failing, you can run it on the command prompt by using "java -jar yourjarname.jar"


Alright I ran the jar in cmd and I know why it's breaking. When it tries to load my Tiled Map is says it's not found then crashes. Everything is referenced correctly or it wouldn't compile and run in Eclipse. So I'm at a loss as to how to fix it. Here the error.

Code:
Tue Aug 21 14:17:07 EDT 2012 INFO:Slick Build #274
Tue Aug 21 14:17:07 EDT 2012 INFO:LWJGL Version: 2.8.4
Tue Aug 21 14:17:07 EDT 2012 INFO:OriginalDisplayMode: 1280 x 800 x 32 @60Hz
Tue Aug 21 14:17:07 EDT 2012 INFO:TargetDisplayMode: 640 x 400 x 0 @0Hz
Tue Aug 21 14:17:07 EDT 2012 INFO:Starting display 640x400
Tue Aug 21 14:17:07 EDT 2012 INFO:Use Java PNG Loader = true
Tue Aug 21 14:17:07 EDT 2012 INFO:Controllers not available
Tue Aug 21 14:17:07 EDT 2012 DEBUG:Setting ResourceManager base directory to 're
s/'
Tue Aug 21 14:17:07 EDT 2012 DEBUG:Trying to load sound file 'Jump4.wav' at key
'jump'...
Tue Aug 21 14:17:07 EDT 2012 INFO:Initialising sounds..
Tue Aug 21 14:17:08 EDT 2012 INFO:- Sound works
Tue Aug 21 14:17:08 EDT 2012 INFO:- 64 OpenAL source available
Tue Aug 21 14:17:08 EDT 2012 INFO:- Sounds source generated
Tue Aug 21 14:17:08 EDT 2012 DEBUG:Trying to load music file 'game_muzask.wav' a
t key 'muzask'...
Tue Aug 21 14:17:08 EDT 2012 DEBUG:Trying to load image file 'winz.png' at key '
winz'...
Tue Aug 21 14:17:08 EDT 2012 DEBUG:Trying to load spritesheet file 'littlered_id
le.png' with width 16 and height 16 without transparent color at key 'lr'...
Tue Aug 21 14:17:08 EDT 2012 DEBUG:Trying to load spritesheet file 'littlered_ru
n.png' with width 16 and height 16 without transparent color at key 'lr_move'...

Tue Aug 21 14:17:08 EDT 2012 DEBUG:Trying to load spritesheet file 'tile.png' wi
th width 16 and height 16 without transparent color at key 'tiles'...
Tue Aug 21 14:17:08 EDT 2012 DEBUG:Trying to load spritesheet file 'coin.png' wi
th width 16 and height 16 without transparent color at key 'coin'...
Tue Aug 21 14:17:08 EDT 2012 DEBUG:Trying to load spritesheet file 'portal.png'
with width 16 and height 16 without transparent color at key 'portal'...
Tue Aug 21 14:17:08 EDT 2012 DEBUG:Trying to load tiled map file 'Level_1.tmx' a
t key 'lvl1'...
Tue Aug 21 14:17:08 EDT 2012 ERROR:Resource not found: res//Level_1.tmx
java.lang.RuntimeException: Resource not found: res//Level_1.tmx
        at org.newdawn.slick.util.ResourceLoader.getResourceAsStream(ResourceLoa
der.java:69)
        at org.newdawn.slick.tiled.TiledMap.<init>(TiledMap.java:90)
        at org.newdawn.slick.tiled.TiledMap.<init>(TiledMap.java:77)
        at it.randomtower.engine.ResourceManager.loadTiledMap(ResourceManager.ja
va:126)
        at it.randomtower.engine.ResourceManager.loadResources(ResourceManager.j
ava:95)
        at it.randomtower.engine.ResourceManager.loadResources(ResourceManager.j
ava:44)
        at com.cnia.angelworks.glr.SetUp.initResources(SetUp.java:44)
        at com.cnia.angelworks.glr.SetUp.initStatesList(SetUp.java:31)
        at org.newdawn.slick.state.StateBasedGame.init(StateBasedGame.java:164)
        at org.newdawn.slick.AppGameContainer.setup(AppGameContainer.java:390)
        at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:314)
        at com.cnia.angelworks.glr.SetUp.main(SetUp.java:63)
Tue Aug 21 14:17:08 EDT 2012 ERROR:failed to load resource file 'res/resources.x
ml': Unable to load resource configuration file
Tue Aug 21 14:17:08 EDT 2012 ERROR:Resource loading failed!
org.newdawn.slick.SlickException: Resource loading failed!
        at com.cnia.angelworks.glr.SetUp.initResources(SetUp.java:48)
        at com.cnia.angelworks.glr.SetUp.initStatesList(SetUp.java:31)
        at org.newdawn.slick.state.StateBasedGame.init(StateBasedGame.java:164)
        at org.newdawn.slick.AppGameContainer.setup(AppGameContainer.java:390)
        at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:314)
        at com.cnia.angelworks.glr.SetUp.main(SetUp.java:63)
AL lib: FreeContext: (05450C28) Deleting 64 Source(s)


Top
 Profile  
 
PostPosted: Tue Aug 21, 2012 8:12 pm 
Offline
Game Developer
User avatar

Joined: Sun Nov 12, 2006 8:40 pm
Posts: 585
Application is failing because its not finding "res//Level_1.tmx", check if that file is inside the jar file (you can open jar files with any zip program). So not really a JarSplice issue any more but more of a loading a file from a jar file (its either missing or you are not loading it correctly).


Top
 Profile  
 
PostPosted: Tue Aug 21, 2012 8:49 pm 
Offline

Joined: Wed Feb 29, 2012 7:07 pm
Posts: 9
Yup all the tiled map files are in the res folder.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 41 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC


Who is online

Users browsing this forum: Google [Bot], MSN [Bot] and 80 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group