How to build jMonkeyEngine in Netbeans?

I am using NetBeans IDE 8.0 to build jMonkeyEngine from sources. The sources in the current state cannot be build for me unless I adjust a few things:

  • I need to disable building SDK (gradle.properties / buildSdkProject = false), otherwise I get following error:

Execution failed for task ‘:sdk:buildSdk’.
The following error occurred while executing this line:
W:\jME\jmonkeyengine\sdk\build.xml:7: The following error occurred while executing this line:
W:\jME\jmonkeyengine\sdk\nbproject\build-impl.xml:41: Cannot find NetBeans build harness.
Check that nbplatform.default.netbeans.dest.dir and nbplatform.default.harness.dir are defined.

  • I need to remove << from the following line, otherwise the jars are not created:

    task dist (dependsOn: [‘build’, ‘:jme3-jogl:jar’, ‘:jme3-bullet:jar’, ‘:jme3-android:jar’]) << {

Note: The << were added in commit - fix dist task in jme3-examples to not run at config time.

I was looking for some step by step guide how to build jME properly, but the one I found seems quite old (it references Google code) and does not seem to contain any information useful in solving the issues above.

I guess I must be doing something wrong. How are other people building the engine?

You probably opened the SDK subproject before building the main gradle project. So first of all delete the sdk/nbproject/private folder.

Then you have to build the main gradle project once (with the SDK build enabled), then open the SDK project in NetBeans and run it from there.