jME in NetBeans

I did everything according to this tutorial:

Except instead of this:


In the VM Options i wrote:

-Djava.library.path="C:Documents and SettingsFabisDesktopjME2jME2lib"

Because the latest version of jME doesn't have a natives folder.

But when i run the Hello3D file i get this:

2009.16.9 00:50:39 start
INFO: Application started.
2009.16.9 00:50:39 com.jme.system.PropertiesGameSettings <init>
INFO: PropertiesGameSettings created
2009.16.9 00:50:39 com.jme.system.PropertiesGameSettings load
WARNING: Could not load properties. Creating a new one.
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: [Lorg/lwjgl/opengl/DisplayMode;
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(
        at java.lang.Class.getDeclaredMethod(
        at java.awt.Component.isCoalesceEventsOverriden(
        at java.awt.Component.access$500(
        at java.awt.Component$
        at java.awt.Component$
        at Method)
        at java.awt.Component.checkCoalescing(
        at java.awt.Component.<init>(
        at java.awt.Container.<init>(
        at java.awt.Window.<init>(
        at java.awt.Window.<init>(
        at java.awt.Dialog.<init>(
        at java.awt.Dialog.<init>(
        at javax.swing.JDialog.<init>(
        at javax.swing.JDialog.<init>(
        at javax.swing.JDialog.<init>(
        at com.jme.system.lwjgl.LWJGLPropertiesDialog.<init>(
        at java.awt.event.InvocationEvent.dispatch(
        at java.awt.EventQueue.dispatchEvent(
        at java.awt.EventDispatchThread.pumpOneEventForFilters(
        at java.awt.EventDispatchThread.pumpEventsForFilter(
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(
        at java.awt.EventDispatchThread.pumpEvents(
        at java.awt.EventDispatchThread.pumpEvents(
Caused by: java.lang.ClassNotFoundException: org.lwjgl.opengl.DisplayMode
        at Method)
        at java.lang.ClassLoader.loadClass(
        at sun.misc.Launcher$AppClassLoader.loadClass(
        at java.lang.ClassLoader.loadClass(
        at java.lang.ClassLoader.loadClassInternal(
        ... 28 more

What's wrong?

the native's are in lib/lwjgl/native/your_operating_system_here

I have followed the tutorial aswell and have had the same problem, the text in the run VM options i have now put as


and i still get the same problem.

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: [Lorg/lwjgl/opengl/DisplayMode;

        at java.lang.Class.getDeclaredMethods0(Native Method)

when running the HelloWorld class.

Any help greatly appreciated, thanks.

I have solved this problem now by also adding the following jar files to the project libraries:





and to be safe i added:



It now runs and I can see the cube and move about without any exceptions… without the audio jar i could see en exception in the console after exiting the graphics engine.

We should really remove that tutorial and force the netbeans users to use SVN. As long as the tutorial is not fixed we will get this complain every day.

I wonder why this problem does only seem to occur at that IDE!? Is the eclipse tutorial already fixed or are eclipse-users more familiar with svn?

That nice big red stable-download-button seems like using this would be the best sollution. But nevertheless it is just a snapshot of a heavily developed engine. We should point out on the download-side that if someone really wants to develop there is no way around using the SVN-Version…(my opinion)

Well ive checked out the source code and i can see some of the .java files i need from jmetest. I have added it to source folders, and tried adding it as a library jar file but neither works and i cannot run testPongCool for example.

It says it cant find the classes it need when im looking right at it!

Surely i dont have to add every jar file in ever subdirectory of lib? but adding the folder doesnt seem to work. Is there an easier way? thanks.

I think the biggest problem is that there a much too less NetBeans-Users (am I right with that?)

I would really like to help! (Maybe I will install it and have a look!)


Well,…ok! I actually installed NetBeans and tried to use this tutorial to get it work:

Well,…I didn't succeed with it in the beginning. Ok,…I'm not familiar with NetBeans so maybe that is the

cause why I find it not usable…Nevertheless I managed to get jME2 work.

Main Problem seems to be that Netbeans is using the maven-project-file (pom.xml) in order to locate libararies. That file is not uptodate.

Here how I did it:

  1. Follow the steps of the tutorial until:

Compile Sources

Now we compile the project, test it, and generate Javadoc.

2) Go in your jme-svn-directory and make a copy of pom.xml.
3) copy the attached pom.xml.txt to your folder and rename it to pom.xml (the forum didn't let me add .xml-files)
Attention: This pom is for windows. If using linux/mac change the swt-dependency to one of the following: "linux,macosx-carbon,macosx-carbon"

Go on with the tutorial:

Right click jME2 project → Click Clean and build.
Right click jME2 project → Click Test the project.
Right click jME2 project → Click Generate Javadoc.

That should have compiled your project and should be available in your {jme-path}/bin

Now right-click your project->properties, go to Run, add your jme-dir as WorkingDirectory and fill
in VM-Options for windows:

(or replace windows through on of the following: "linux,macosx,solaris")

Now choose a test-class in MainClass you might want to see:
e.g. jmetest.TutorialGuide.HelloTerrain

Apply with ok-button.

Go to run->run project.

Hopefully that might work. Actually I tried lot the last time now and I might have forgotten a step.

Actually I'm no netbeans-user and will surley never be....I will uninstall it in 5 hours so if there are
questions ask them now.

Have a look here:

That might be the better choice

Okay i created a freeform project and cleaned and build successfully test and run can choose different tests from the chooser but still most files say they have errors in but i can run them. And the errors it gives it cant find symbol of a class i can see in the package right next to it?!

JulianJC said:

Okay i created a freeform project and cleaned and build successfully test and run can choose different tests from the chooser but still most files say they have errors in but i can run them. And the errors it gives it cant find symbol of a class i can see in the package right next to it?!

Have you added all four libraries you where supposed to create to your test project (from this tutorial: )?

if you follow the above tutorial with the additions to what is said in the previous mentioned thread (my thread actually) everything should work.

Pay attention to that some imports can be wrong, in some files they import (for an example) "import flagrushtut.lesson6.Vehicle;" while in some they import them as "import jmetest.flagrushtut.lesson6.Vehicle;". If you haven't included the jmetest folder in your project the later version of the import won't work.

I've actually run into this problem now (lwjgl).

Like i said in the other thread, i run jme through a netbeans freeform project having used svn to download it, and have been doing it for over a month now with out any problems (except having to manually add jmetest stuff like you mentioned).

However, as i was checking some applet stuff, looking at, the following packages don't exist:

import org.lwjgl.LWJGLException;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.PixelFormat;

I tried bunching the jar's JulianJC mentioned into a library and linking it to my project to no avail. I guess it needs to be compiled with jme, but i can't figure out how to add them to the freeform project.
Using ttrocha's pom.xml did not work either.
Is it somehow related to this step under the Eclipse setup?

Use the Add JARs button to add the following JAR files, found under workspace/jme/:


Did you followed the Netbeans 6.1 tutorial?

So you have jME2-Compile and jME2-Run libs?

or what libs do you have to run Netbeans Projects with jME?

If you followed the tutorial, than just put the jME2-Run lib from the Run-Tab in your Project's library setting to the Compile tab… (delete it from the Run libraries and add it to the Compile time libraries…)

Is the reply aimed to me?

If so, yes, i have followed the tutorial, and jme builds fine. I have all the libraries from the tutorial.

The problem seems to be that the main project itself seems to be lacking those packages.

Please bear in mind that some while ago when i synced the latest, the jmetest-packages wouldn't be compiled either (sources are there, but nothing shows up in build).

I've checked the build.xml but it seems to be alright (i'm certainly no expert at interpreting .xml's though)