Hey guys, i’ve finished my little game, now how can i make a “installer” to distribute the game? And a “shortcut” to open it like “minecraft/revenge of the titan” ;D
Thank you
Uh, .jar? Or convert it to .exe. Unless your game is really big I see no need for an installer.
Jar file and simple c program or shell script to invoke the jvm.
My game is not big but without installer is “too” tatty
So how can i do the “program” or shell script :S?
Distribute as a zip containing your jar, resources, and script.
The script just has to call
java(w) -jar jarname -Djava.library.path. any dependencies
Excuse me :S, how the script? What kind of script(.sh,.bat)? How can i do for window and linux? I don’t know very much about that
on windows just put what i have above in gamename.bat. on linux it goes in a .sh file. on linux you will need to add “#!/bin/sh” without quotes to the file. you may also need to chmod it to be executable.
Thank and the last question, could you explain to me what’s this
-Djava.library.path. any dependencies
what does it do?
Sorry for too question, it’s the first time i release a java app :S
That’s only if you have natives you want the JVM to load, like for LWJGL for example. If not, then ignore and do not add it
lol no one mention Mac?
You could create a launcher, which the user will download.
The launcher will then download the actual .jar and any files (you could pack it into a zip for download, and just save all files exactly in the right position in the zip, probably the easiest way) and put it in the right path. e.g. when you press play, the launcher will check the appropriate file path for the game, if it does not exist, download the files then launch the game.
The launcher then can have a update check in it, compare the current version to a text file and check to see if it needs updating, if it needs updating, download the file. If not, just start the game instantly.
The problem is i don’t know how to make it
There is no need of launcher if your game is relatively small/rarely updating.
:S Okay then a normal installer without updating
:S GUYS!! :(, how can i call the “java jar” with the script… So it’s works perfectly but don’t know how to load jinput too :S
First check the licences of your dependencies so that you can merge them ( No Licence will object you I think ). You can make it an exe for windows platform ( See http://transfer2pc.weebly.com/1/post/2011/10/jar2exe-converter-11-gui.html My jar to exe converter ) For linux, pack it in a zip along with a script (.sh)
java -jar merged_jar.jar
Or you can package them into deb or rpm packages.
but how can i “use” my jar with jinput. the error is
INFO: Failed to load library: no jinput-linux in java.library.path
Did you merge the jar?
If so make the code like this
java -jar merged_jar.jar -Djava.library.path=jinput-linux.so
how can i merge the jar?
how can i activate jinput for win & mac too?