Need help on First APP

So, I have every thing i need for it to work, so i tried to do the "creating your first app" thing on the wiki. It says I should have a window that is opened, but it doesnt do anything.

Here is my code:

import com.jme.scene.shape.Sphere;
import com.jme.bounding.BoundingBox;
import com.jme.math.Vector3f;

public class JavaMonkeyEngineTest extends SimpleGame{
   public static void main(String[] args) {
      JavaMonkeyEngineTest app = new JavaMonkeyEngineTest();
   protected void simpleInitGame() {
      Sphere s = new Sphere("Sphere", 30, 30, 25);
      s.setLocalTranslation(new Vector3f(0,0,-40));
      s.setModelBound(new BoundingBox());

It doesnt do anything. (By the way, I am using JCreatorLE)
However, it does give some output in the console:

what does the console output look like?

Could be you are missing the .dlls for lwjgl. you need to use the -Djava.library.path=<location of the lwjgl.dlls> . They should be in the jmonkeyenginelib.

I posted the output in the console above.

if you're using netbeans, on project properties, in run option, put your libraries directory on it (-Djava.library.path="your_libraries_dll_") on VM options…

you need to specify where your libraries and dll's are…  :wink:

I am using JCreator(LE). You just set which external .jars the current project uses. I set that to everything in the nightly build zip, including that which is in the lib folder.

Any ideas?


I am not familiar with JCreator, but it has to have a way to add VM arguments. Setting external jars or dir will not work, that addes stuff to the classpath which is different from the java.library path. Check your run config screen(if it has one) for a box labed VM options or VM parameters

I could not find any way to add VM arguments in JCreator, nor could i find any ways on Google. So I installed Eclipse. :slight_smile: How do I add VM arguments in Eclipse?

The tutorials will help you. I have posted the links in that thread:

  • justin

It seems that I have done what they said and have set the VM arguments as:

-Djava.library.path=./lib -cp ./lib/lwjgl.jar;./lib/jogg-0.0.5.jar;./lib/jorbis-0.0.12.jar;./target/jme.jar;./target/jme-awt.jar; ./target/jme-effects.jar;./target/jme-model.jar;./target/jme-sound.jar;./target/jme-terrain.jar;./target/jmetest.jar; ./target/jmetest-data.jar

(Which appears on 4 lines there, not one), and have clicked apply.

However, when I run it, it tells me it cannot find the main class and that it will exit, and then writes this in the console.:

java.lang.NoClassDefFoundError: //target/jme-effects/jar;//target/jme-model/jar;//target/jme-sound/jar;//target/jme-terrain/jar;//target/jmetest/jar;

Exception in thread "main"

Ive tried a few things that could help, but none work. Could you help? I really want to start actually programmming stuff.

I can't help you with eclipse, because i am using netbeans. The eclipse guide is older, maybe that is the reason for your problems.

If netbeans as IDE would be ok for you, than i suggest to use netbeans. The netbeans guide is up-to-date and should work.

  • justin

Yeah, I'd also suggest you to use netbeans…


Must I install more than one IDE per day? Does anyone know what is wrong in eclipse?

I got eclipse to work! As in the IDE! sort of… anyway, when i run it without the VM arguments, it gives the same output as JCreator. (See above). When I do add in the VM arguments said in the wiki, it says it can't find the main class, and prints the following in the console:

java.lang.NoClassDefFoundError: //target/jme-effects/jar;//target/jme-model/jar;//target/jme-sound/jar;//target/jme-terrain/jar;//target/jmetest/jar;

Exception in thread "main"

Note: the target folder(which i made later), the lib folder, and the jars (the same ones in the target folder, only outside it) are not in the same directory as my main class file.

What should I do to fix this? In the Arguments tab in eclipse, should I change the Working Directory? Should i put the lib and target folders with my main class file? In the main class statement (in the run config), should it have no extension, .class, or .java? Please, HELP ME!  :x :x :x :? :? :? :frowning:

Thanks in advance,


I got it to work, some how.

      Thank you for all your help.

I updated the wiki article a bit.