Ok,
after everything I tried to get jme working under eclipse 3.5 failed completly and my eclipse environment broke in the process, I decided to take an other rute to get startet. I therefore tried to set up jme manually as described in the "getting startet" tutorial. Everything worked fine. I could build jme without any error messages. The same is true for the test applications. I tried to execute all of them, and they all seem to work as they are supposed to. So for the moment I assume the installation is ok.
The next step for me would be to compile some simple jme projects. It seems I need a bit assistance for doing this. I couldnt answer my question myself by studying the wiki materials and the contributions on this forum. It might be out there, but I wasnt able to spot it.
I tried the following: I copied the HelloWorld.java program from one of the tutorials into my jme "base" folder and called
(from this folder)
javac -cp ./lib/:./target/ HelloWorld.java
This resulted in "cannot find symbol, symbol: variable ConfigShowMode"
So what would be the right way to do this?
I know this is a ridiculous question for the most of you and I apologize for that. I can promise you that my stupid questions stop very soon after I got some minimal grip on an issue (like beeing able to compile simple projects manually …). I would highly appreciate any help. Thank you in advance.
Questions are never ridiculous.
Your build platform seems ok. ConfigShowMode is a nested type of AbstractGame. You have to import it:
import com.jme.app.AbstractGame.ConfigShowMode
or import the base package:
import com.jme.app.*;
and use the Outer.Inner qualifier
AbstractGame.ConfigShowMode.xyz
Thank you pgi,
so my real problem here was a lack of basic java knowledge…
I have to do a lot more homework on that.
Thanks again
Hm,
when I
import com.jme.app.AbstractGame.ConfigShowMode;
javac complains about not finding a class named "ConfigShowMode" in the class com.jme.app.AbstractGame. Inspection of AbstractGame.java confirms its not there. In the code I try to compile, ConfigShowMode is used in this context
HelloWorld app = new HelloWorld(); // Create Object
// Signal to show properties dialog
app.setConfigShowMode(ConfigShowMode.AlwaysShow);
HelloWorld extends SimpleGame,which extends BaseSimpleGame, which extends BaseGame, which in turn extends AbstractGame. ConfigShowMode is embedded in neither of these. But according to my understanding it has to be in one of those classes for the above code to compile and execute (please correct me if this is wrong). So is this maybe a jme version issue? The code I try to compile is from 2004.
that's strange. I have it as a public enum in AbstractGame. The svn codebase seems to confirm it:
http://code.google.com/p/jmonkeyengine/source/browse/branches/2.0.x/src/com/jme/app/AbstractGame.java
I also checked the JME 2.0.1 jar dowloaded from this site
http://www.jmonkeyengine.com/wiki/doku.php?id=download
and it seems to be there too.
Thats funny. Its clearly there in the files you showed (right at the top, not to miss).
And its clearly absent in my local copy. I will explore this tomorrow. It is sleepy time where I live (at least for me).
Thank you for your help. I will report soon.
Ok,
I just checked the version tag of my local copy. Its jme 1.0. So I guess I just made a silly job yesterday when I was installing jme, checking out an outdated branch of jme.
I have jme 2 now. Using ant, I could compile jme and all tests without error messages. I could for the first time compile HelloWorld.java. But I cant execute anything. All tests I tried as well as HelloWorld give me exceptions:
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: [Lorg/lwjgl/opengl/DisplayMode;
at java.lang…
…very long sermon…
…28 more
I dont had this problem with jme1.
I think I saw this problem mentioned elsewhere in the forum. Now I'm digging through the pages looking for the answer.
I'm sure its already there. Is this maybe related to the opengl version on my system?
This is how i did it.
dowload eclipse 3.5
dowload JME2_0_1-stable.zip from http://code.google.com/p/jmonkeyengine/downloads/list and extract it [somewhere]
open eclipse
window -> preferences -> java -> build path -> user libraries
press new
user library name -> "JMonkeyEngine 2.0.1" (leave System Library unchecked)
press ok
press "Add JARs…" and add:
[z:jme2_0_1-stable.zip]libjme.jar
[z:jme2_0_1-stable.zip]libjme-audio.jar
[z:jme2_0_1-stable.zip]libjme-awt.jar
[z:jme2_0_1-stable.zip]libjme-collada.jar
[z:jme2_0_1-stable.zip]libjme-editors.jar
[z:jme2_0_1-stable.zip]libjme-effects.jar
[z:jme2_0_1-stable.zip]libjme-font.jar
[z:jme2_0_1-stable.zip]libjme-gamestates.jar
[z:jme2_0_1-stable.zip]libjme-model.jar
[z:jme2_0_1-stable.zip]libjme-ogrexml.jar
[z:jme2_0_1-stable.zip]libjme-scene.jar
[z:jme2_0_1-stable.zip]libjme-swt.jar
[z:jme2_0_1-stable.zip]libjme-terrain.jar
[z:jme2_0_1-stable.zip]liblibjme-colladabinding.jar
[z:jme2_0_1-stable.zip]liblibjogljogl.jar
[z:jme2_0_1-stable.zip]liblibjoglglue-gen-rt.jar
[z:jme2_0_1-stable.zip]liblibjorbisjorbis-0.0.17.jar
[z:jme2_0_1-stable.zip]liblibjunitjunit-4.1.jar
[z:jme2_0_1-stable.zip]libliblwjgljinput.jar
[z:jme2_0_1-stable.zip]libliblwjgllwjgl.jar
[z:jme2_0_1-stable.zip]libliblwjgllwjgl_util.jar
[z:jme2_0_1-stable.zip]libliblwjgllwjgl_util_applet.jar
[z:jme2_0_1-stable.zip]liblibswt[YOUR OS]swt.jar
Now bind the dynamic libraries. Each jar entry in the library has a "Native library location" child node.
Double click the "Native library location" node of the jogl.jar branch.
Press "External folder", select the directory:
[z:jme2_0_1-stable.zip]liblibjoglnative[YOUR OS_ARCHITECTURE]
Double click the "Native library location" node of the lwjgl.jar branch.
Press "External folder", select the directory:
[z:jme2_0_1-stable.zip]libliblwjglnative[YOUR OS]
Press "OK".
Now you have a library that can be used in your eclipse projects. To test it:
window -> open perspective -> Java (default)
file -> new -> java project -> project name "jmetest" -> next
in the "libraries" tab -> Add Library… -> User library, next -> check JMonkeyEngine 2.0.1 -> finish
press Finish.
file -> new -> package -> name "jmetest" -> finish
file -> new -> class -> name "Main" -> finish
The main class is:
package jmetest;
import com.jme.app.SimpleGame;
import com.jme.math.Vector3f;
import com.jme.scene.shape.Box;
public class Main extends SimpleGame {
public static void main(String[] args) {
Main app = new Main();
app.setConfigShowMode(ConfigShowMode.AlwaysShow);
app.start();
}
protected void simpleInitGame() {
Box b = new Box("Mybox", new Vector3f(0, 0, 0), new Vector3f(1, 1, 1));
rootNode.attachChild(b);
}
}
menu run -> run -> press ok in the Save and launch dialog
It should work.
Thanks again pgi,
I will work through your procedure this evening and report how it worked for me.
Hi pgi,
I just worked through your perfectly idiot-proof step-by-step howto. Everything works perfectly. I could run your jmetest program. It works as it is supposed to. Thank you!!!
Best regards and thanks again
Matthias