Make your game distributable

Hi, in the page how to use jme with NetBeans,



http://www.jmonkeyengine.com/wiki/doku.php?id=setting_up_netbeans_5.0_to_build_jme_and_jme-physics_2



In section d, explain how to make your game distributable, I followed the steps, but Mygame.jar is not yet distributable, I just get a debug.txt file that says(and can’t see anything else) :


17/08/2007 01:00:42 AM com.jme.app.BaseGame start
INFO: Application started.
17/08/2007 01:00:42 AM com.jme.system.PropertiesIO <init>
INFO: PropertiesIO created
17/08/2007 01:00:42 AM com.jme.system.PropertiesIO load
ADVERTENCIA: Could not load properties. Creating a new one.
17/08/2007 01:00:43 AM com.jme.app.BaseSimpleGame cleanup
INFO: Cleaning up resources.
17/08/2007 01:00:43 AM com.jme.system.lwjgl.LWJGLDisplaySystem <init>
INFO: LWJGL Display System created.
17/08/2007 01:00:43 AM com.jme.app.BaseGame start
INFO: Application ending.




Does anyone know what I missing?, maybe I need add another file. Thanks for your help.

you probably get some kind of exception why don't you post it here.



if you want to see your exception open the console and type "java -Djava.library.path=xxxxxxxxx -jar yyyyyyyyy" where xxxxxxx is path to your dll's and yyyyyyyyyy the path to your jar file.

Thanks for your idea, I did it in the console, and it worked. So the problem are the libraries. How can add them to my jar? I doesn't say anything about them in the set up.

create a folder, name it xxxxx place all the files from jMElib in it. Place the folder in the directory whre your jar file is.

When running jar just supply "java -Djava.library.path=xxxxxxxxx -jar yyyyyyyyy"

If you do this and still see an exception post it here…

I was hoping I could add the libraries withouth using  "java -Djava.library.path=xxxxxxxxx -jar yyyyyyyyy", but I think the project is working. Thanks for your help

you could do so by putting all the files from lib in the same folder where your jar is. and just double clicking the jar from windows.

but this is not very tidy.

Also, you could add the classpath information for the libs to a manifest file in your jar, then double clicking should launch fine.



It should look something like this:

Manifest-Version: 1.0
Class-Path: ./lib/jme.jar ./lib/jme-awt.jar ./lib/jme-model.jar ./lib/jme-terrain.jar ./lib/log4j-1.2.9.jar ./lib/lwjgl.jar ./lib/odejava.jar ./lib/vecmath.jar ./lib/native-mac.jar
Main-Class: com.acarter.crawlin.Main



this way the natives stil need to be in the same directory as your jar. Maybe you could specify thos in the classpath too, havn't tried

no you can't specify library path in the manifest file ( as i've heard ).

If you mean you cant do this:

Manifest-Version: 1.0
Class-Path: ./lib/jme.jar ./lib/jme-awt.jar ./lib/jme-model.jar ./lib/jme-terrain.jar ./lib/log4j-1.2.9.jar ./lib/lwjgl.jar ./lib/odejava.jar ./lib/vecmath.jar ./lib/native-mac.jar
Main-Class: com.acarter.crawlin.Main



then I would say you are incorrect. But if you are talking specifically about the natives then I would take your word for it, as I have not tried.
nymon said:

If you mean you cant do this:

Manifest-Version: 1.0
Class-Path: ./lib/jme.jar ./lib/jme-awt.jar ./lib/jme-model.jar ./lib/jme-terrain.jar ./lib/log4j-1.2.9.jar ./lib/lwjgl.jar ./lib/odejava.jar ./lib/vecmath.jar ./lib/native-mac.jar
Main-Class: com.acarter.crawlin.Main



then I would say you are incorrect. But if you are talking specifically about the natives then I would take your word for it, as I have not tried.

yes i mean the natives. that is class path, not the library path.

Unfortunately there is no easy way to include the native libraries or java.library.path in the jar file. Renanse has pointed out this, so if he does not know how, then probably simply there is no workaround.  :’(

One workaround is how lwjgl applets work (check for loaded native, if not found, extract and add).  Here's a thread:



http://forum.java.sun.com/thread.jspa?threadID=770565&messageID=4390995

this is just stupid  :cry:



is there a reason for not being able to do this …