For development with the jMonkeyEngine 3, we recommend to use the jMonkeyEngine SDK.

Alternatively, you can use your favorite IDE: In this tutorial we show how to download and set up the latest nightly build of the jMonkeyEngine 3 for use with the NetBeans IDE. Instructions for Eclipse are also available.

Note that the jMonkeyEngine SDK is built in top of the NetBeans Platform, and is identical to the NetBeans IDE for Java (plus some unique NetBeans plugins). Basically it’s redundant and unnecessary to set up jME for NetBeans – but if you want to, it’s easily possible.

Downloading jME3

The currently available JAR binaries are the nightly builds.

  1. Download the most recent zipped build from http://nightly.jmonkeyengine.org/

  2. Unzip the file and save it as jME3_xx-xx-2010 in your NetBeansProjects directory. You should see the following files and directories:

    1. lib/ – The jMonkeyEngine binaries and libraries. (Don’t remove.)

    2. TestChooser.exe – Run this file to see various feature demos. (optional)

    3. javadoc/ – jME3 API documentation. (optional)

Creating a Project

In NetBeans, choose File > New Project, select Java > Java Application, click Next.

  • Project Name: HelloJME3

  • Project Location: ~/NetBeansProjects

  • Create main() Class: No

  • Set as Main Project: Yes.

  • Click Finish

The new project appears in the Projects window.

Setting up Dependencies

Your project depends on the jMonkeyEngine libraries and needs to know where they are.

  1. In the Projects window, right-click the project’s Libraries node and choose “Add JAR/Folder.

  2. In the “Add JAR/Folder dialog, browse to the NetBeansProjects/jME3_xx-xx-2010 directory.

  3. Select all JARs in lib/ and click Select.

The necessary libraries are now on the classpath and should appear in the Libraries list.

Optional: Configuring the JavaDoc Popups in NetBeans

Configuring Javadoc popups for jme3 classes in NetBeans can be very helpful during the development phase of your game.

  1. In the HelloJME3 project

    1. Right-click the Libraries node and choose Properties from the context menu

    2. Select the jMonkeyEngine3.jar library entry from the list and click Edit.

      1. Javadoc: Browse to JME3’s javadoc directory and click select.

      2. Sources: Browse to JME3’s `src`directory and click select.

    3. Click OK.

Open a class of your HelloJME3 project, place the caret into a jme3 class, and press ctrl-space to see the javadoc popup, as well as code-completion.

Build & Run Tips in NetBeans

How to build and run in NetBeans:

  • Clean and build the whole project by pressing Shift-F11.

  • Run any file that is open in the editor and has a main() class by pressing Shift-F6.

  • Run the Main class of the project by pressing F6.

Tips for configuring the main class in NetBeans:

  • Right-click the HelloJME3 project and choose “Set as main project. Now you can use the toolbar buttons (clean&build, run, debug, etc) to control this project.

  • Right-click the HelloJME3 project and choose Properties. Go to the Run section.

  • Under Main Class, specify the class that will be executed when you run the whole project. For now, enter hello.HelloJME3.

Writing a SimpleApplication

You can now continue to write your first jme3 application!