Problems with jME in a jar

Hey all,



I’ve been running into some frustrating problems with jME in jars. It’s easier to explain if I just show you them.



http://www.geocities.com/eddeshun/N3D_013.jar

http://www.geocities.com/eddeshun/N3D_014.jar



EDIT okay… well geocities is a pain in the back. If those dont work just go here

http://www.geocities.com/eddeshun/index.html



The simple objective is to have the player double click on a JAR, have the JMonkey properties prompt come up, then start the game.



Prior to these two jars I had the complete game set up, extending BaseGame, in an eclipse project. It worked perfectly whenever I ran it as an application. When I tried to turn it into a jar, though, it would not find the main class. 14 Saves later, I am at the end of my rope, and about to break stuff.



Should I include jars of jme and lwjgl in the jar? How should I call them? If I must make an EXE to make the above work, how do I do that?



ADD I downloaded jmetest and jmetest-data from https://jme.dev.java.net/servlets/ProjectDocumentList?folderID=148&expandFolder=148&folderID=0

however when I double click on the jmetest.jar nothing happens. I was sort of hoping to mimic how it worked with the test, but the test doesn’t even seem to be working…



Please, any help will do.

DeShun

@jjmontes: very nice explanations. do you mind putting them into the wiki under some topic like "packaging and deploying" ? after that we could add some small references/explanations to webstart and other deployment tools like launch4j (http://launch4j.sourceforge.net/) and jsmooth (JSmooth - Java Executable Wrapper)

Ahhhh, thanks, that cleared up a whole bunch  :slight_smile:



:frowning:



Off of the jar, though, now I'm having another problem! Here, I'll upload this one too…



http://www.olog-hai.be/tiki/tiki-download_file.php?fileId=9



The problem I have now is in using the .bat file. I try to run start.bat from the command window and it cant seem to locate the darn jars. If you try "dir .libjme.jar", though- it can find it! Can't in the start.bat, can if you manually check. hmmm.

you'll have to learn how to use the VM arguments. here's the correct bat file.


@echo off
java -cp ./bin;./lib/jinput.jar;./lib/jme.jar;./lib/jme-awt.jar;./lib/jme-effects.jar;./lib/jme-model.jar;./lib/jme-sound.jar;./lib/jme-terrain.jar;./lib/lwjgl.jar;./lib/lwjgl_test.jar;./lib/lwjgl_util.jar;./lib/lwjgl_util_applet.jar -Djava.library.path=./lib/win32 game.Game

:smiley: thank you o-spiky haired one!  :smiley:



I am in both of your debts eternally.

i'm not spiky haired. :stuck_out_tongue: i just don't have any defined haircut anymore since i cut my very long hair.

what you call spikes, could also be an abstract representation of my thoughts trying to evade my head, or the horns i'm growing in order to defend myself from darkfrog (the godfather of the amphibian mafia)  XD

sfera said:

@jjmontes: very nice explanations. do you mind putting them into the wiki under some topic like "packaging and deploying" ? after that


Of course I don't mind. I feel honoured.

I was thought that the wiki was private for developers, but I've seen that it is open. I'm glad to contribute and I hope that someone benefits from the article.

http://www.jmonkeyengine.com/wiki/doku.php?id=packaging_and_deploying_jme_applications

Please correct whatever you find wrong.

Great you added that to the wiki.



As for the installer: one could mention IZpack which I know to support native libraries, so it should work with jME apps…



Somewhat offtopic: some paragraphs look quite strange formatted in my browser (Firefox 2) - no idea how to fix that, though.

edit: IzPack added, formatting adjusted, mentioned linux -cp separators, link to the jar specification added, applet link corrected, link beautifying. please review.

Grrrr… yet another problem… this time with Timer.





java.lang.NullPointerException

at game.Game.update(Game.java:180)

at com.jme.app.BaseGame.start(Unknown Source)

at game.Game.main(Game.java:58)

Jan 22, 2007 8:53:15 PM com.jme.app.BaseGame start

INFO: Application ending.







Whereas:


protected void update(float interpolation) {
timer.update(); //Update the time to get the framerate.
interpolation = timer.getTimePerFrame(); //Sets the interpolation time to be the framerate.
.........
protected void initSystem() {
width = properties.getWidth(); //Sets width to current width.
height = properties.getHeight(); //Sets height to current height.
depth = properties.getDepth(); //Sets depth to current depth.
freq = properties.getFreq(); //Sets freq to current freq.
fullscreen = properties.getFullscreen(); //Sets fullscreen to fullscreen (yes or no).
timer = Timer.getTimer(this.getVersion()); //Makes a new timer for FPS updates.
.........


*ADD*    Nevermind, I'm finally starting to figure out things on my own  :D Thanks guys... it was that I was running an older version of JME... I downloaded 0.10 off the website and not the nightly build.
sfera said:

edit: IzPack added, formatting adjusted, mentioned linux -cp separators, link to the jar specification added, applet link corrected, link beautifying. please review.


Cool!

Nice. Let's hope it helps someone :)

Thanks for reviewing it.

you don't need to thank me.

we'll have to try out those deployment tools/installers. i know i tested launch4j and jsmooth a while ago, but not with jme.