SFML community forums

Bindings - other languages => Java => Topic started by: Helios101 on December 15, 2014, 07:29:08 pm

Title: .
Post by: Helios101 on December 15, 2014, 07:29:08 pm
.
Title: Re: How to depoly JSFML game?
Post by: pdinklag on December 16, 2014, 11:03:37 am
(First off, note that this is not an Eclipse support forum, and I can't help with Eclipse specific problems at all.)

Quote
Extract required libraries into generated jars
This sounds scary, what exactly does this do?
I recommend not merging contents of other libraries into your own jar. You might run into licensing troubles - not concerning JSFML, but generally this is an issue. Rather set your jar's classpath in the manifest to jsfml.jar and deploy that separately. It's also easier to update if ever necessary.

Quote
the window pops up and the rest of the window is blank white. Then it stops responding.
Is it your game's window? If so, sounds to me like resources can't be found. You share too little information about your project, though, so I cannot really help here.

Make sure that your resources are available in the deployed version. If you load them from the classpath, make sure they're in your jar file. If you load them file-based, you cannot contain them in your jar, but you need to deploy the directory as it is in your development environment.
Title: Re: How to depoly JSFML game?
Post by: pdinklag on December 18, 2014, 06:43:09 am
Well, how are your resources laid out, and how do you load them? Maybe let's know where your background image is located in your project, and how you load it in the game? That might help getting the answer here. :)

Quote
Do you by any chance know how to do this in Eclipse? Where is the manifest supposed to be located
Nope, I'm not using Eclipse myself, but that bit of info should be easy to find out there.
Title: Re: How to depoly JSFML game?
Post by: liesard on January 26, 2015, 12:47:56 am
Well first of all, you shouldn't be putting your resources into the bin/ directory, as that is for binary files (.class files) and not for resources (images and sounds).  Those should be put into the res/ directory for organisation.
Try using the 'Package required libraries into generated JAR' option.  It's what I normally use and it works for me.  Also, make sure that you have put the JAR package into the same directory as the project, as that's where all the resources are.  If that doesn't work, then run it from the command line and tell us what the error message is.
If your class files are in the bin/ directory, then the command will be:
Code: [Select]
java -cp bin/;lib/jsfml.jar com.your.package.name.Main(Main will be replaced with the name off the class with the main method in it.  If you're on OS X, Linux or *BSD, then replace that semicolon with a colon)