How to compile from source?

Hi,

I just cloned the github repo and wanted to compile the SDK from source to have a look at the new nifty editor.
(The plugin cannot install in JME SDK 3.0, because the dependency “XML MultiView Editor” is missing)

Now I had several problems and do not know how I should compile the SDK.

  1. The documentation is very old, talking about SVN and ant.
  2. executing gradlew seemed to “only” download netbeans. If it created binaries, the output did not tell me that it did and where it put them.
  3. the build.gradle in jme3-jbullet references the nonexisting folder “jme3-bullet”. Typo?
  4. There is no netbeans project to import (I just imported the gradle project into IntelliJ IDEA then)
  5. When I run the gradle build scripts, I get no feedback.

Why is the build process not straight-forward? The README in the repo does not help me with installation either.
How do I compile the SDK?

1 Like

run the gradle build once, then run the SDK project in NetBeans or the SDK. Its not straight forward because its a development version you decided to use.

When I run the main gradle build (default task is run), it cannot find physics dependencies:
[java]/home/zanval/workspace/jmonkeyengine/jme3-jbullet/src/main/java/com/jme3/bullet/PhysicsSpace.java:57: error: package com.jme3.bullet.control does not exist
import com.jme3.bullet.control.PhysicsControl;[/java]

I am new to gradle. I only know how to invoke tasks. If gradle requires additional configuration for jME3, that could be my problem.

I understand that this is not the version people should work with, but a version which is under development.

It would be nice to have this process documented somewhere so it is easier to contribute to the project.

1 Like

You said you’re missing the jme3-bullet folder, something is wrong with your checkout.

@zanval88 said: It would be nice to have this process documented somewhere

I agree. It wasn’t a straightforward process for me as well.
At the moment I got a working SDK on my computer but on my friends computer the terrain editor is mising - even tough using the same installer.
I’m certain I did something wrong at some point while creating the installers, but, well, there is no manual. And no nightlies that’d simply things.

My remote is: https://github.com/jMonkeyEngine/jmonkeyengine.git
The only branch there is master, and I am up to date with HEAD.

I made a fresh clean install of Gradle 2.1 (previously used a gradle version which came with IntelliJ IDEA)

It seems this clean Gradle 2.1 finds all dependencies but the following:

[java][ant:nb-javac] /home/zanval/workspace/jmonkeyengine/sdk/jme3-gui/src/com/jme3/gde/gui/nodes/GElementNode.java:25: error: package sun.beans.editors does not exist
[ant:nb-javac] import sun.beans.editors.BoolEditor;
[ant:nb-javac] ^
[ant:nb-javac] /home/zanval/workspace/jmonkeyengine/sdk/jme3-gui/src/com/jme3/gde/gui/nodes/GElementNode.java:26: error: package sun.beans.editors does not exist
[ant:nb-javac] import sun.beans.editors.BooleanEditor;[/java]

Theres the folder, in master, HEAD:

You have an issue with your checkout.

And again, this is the DEVELOPMENT branch, which you use when you are a DEVELOPER, not when you try to make a usable SDK for somebody.

@normen said: And again, this is the DEVELOPMENT branch, which you use when you are a DEVELOPER

I discovered two bugs in the stable version, reported them and both were fixed in the master branch only.
Though I’ll admit, both bugs can be worked around in the stable version, I just wanted to continue to use the blender model loader instead of converting to ogre first.

Except this building issue, the master branch works fine for me and I’m enyoing having gamma correction and being able to play around with the new profiler.

Still, master does not respect the api. One commit might brake your app. Running master in production environment can always be an issue.

Building the SDK itself is kind of an issue, since you need to modify the properties to locate netbeans… or have the c++ compiler installed if you want to build bullet natives. Not a deal breaker, but it is not ment to be an out-of-the-box solution for everyone…

If you try to import the project in intellij, you have to modify the jme3-bullet grade file. IntelliJ does not allow source-references from outside the module…

1 Like
@m41q said: I discovered two bugs in the stable version, reported them and both were fixed in the master branch only. Though I'll admit, both bugs can be worked around in the stable version, I just wanted to continue to use the blender model loader instead of converting to ogre first.

Except this building issue, the master branch works fine for me and I’m enyoing having gamma correction and being able to play around with the new profiler.

The blender loader as it is in master isn’t compatible to the stable version and gives completely different results, furthermore it actually works with less different blender files currently. And as zzuegg said, we KNOW that the development version will break. For example SimpleApplication is going to be removed and Application changed, just for starters.

The whole question is like going in the kitchen where your wife makes a cake, eating the raw eggs and asking why it doesn’t taste like cake or you cannot cut a piece from it…

@zzuegg said: Building the SDK itself is kind of an issue, since you need to modify the properties to locate netbeans..

Actually the build script downloads the NetBeans platform and creates the needed properties file, unless it already exists, then it expects that you use your own NetBeans installation to build and run the SDK. At least thats how its supposed to work and in the latest clean checkout I did that worked.

@zzuegg said: If you try to import the project in intellij, you have to modify the jme3-bullet grade file. IntelliJ does not allow source-references from outside the module..

Duh. Do you know if theres any possible workaround for that or is it an accepted problem in IntelliJ that is supposed to be addressed?

@normen said: Actually the build script downloads the NetBeans platform and creates the needed properties file, unless it already exists, then it expects that you use your own NetBeans installation to build and run the SDK. At least thats how its supposed to work and in the latest clean checkout I did that worked.

Duh. Do you know if theres any possible workaround for that or is it an accepted problem in IntelliJ that is supposed to be addressed?

Hm, remembering that i had to adjust some paths.

Well, the guys from intellij stated: “In this special case we are not as flexible as gradle.” From what i get they are not going to investige the issue.
After all, building is done with gradle so there is no problem there. Its just that it won’t import correctly.
From what i remember you have to remove the line “srcDir ‘…/jme3-bullet/src/common/java’” in jme3-jbullet/build.gradle before you import and generate an intellij project. After the import you can then add that line again.

But i am testing it again currently to make sure

@zzuegg said: Hm, remembering that i had to adjust some paths.

The file in question should be sdk/nbproject/private/platform-private.properties and is created here:
https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/sdk/build.gradle#L47

Re: The other thing: Guess its an IntelliJ problem then, I don’t see why we should duplicate the code in common just to make it work in IntelliJ, might be jbullet is being removed altogether at some point anyway. For bullet we plan to have precompiled libraries that get copied in when the native build cannot run (or for platforms it can’t run for).

Okay, the workaround for "bullet is the same as described above.

Regarding the sdk build:

The file generated contained:
[java]
nbplatform.default.netbeans.dest.dir=D:_Programming_JMonkeyEngine\netbeans
nbplatform.default.harness.dir=D:_Programming_JMonkeyEngine\netbeans/harness
[/java]

It could be because of my underscore directory names, but i had to change the file to:

[java]
nbplatform.default.netbeans.dest.dir=D:/_Programming/_JMonkeyEngine/netbeans
nbplatform.default.harness.dir=D:/_Programming/_JMonkeyEngine/netbeans/harness
[/java]

Now it seems to resolve all correctly, but i still get some erros:
[java]
[ant:nb-javac] D:_Programming_JMonkeyEngine\sdk\jme3-gui\src\com\jme3\gde\gui\nodes\GElementNode.java:25: error: package sun.beans.editors does not exist
[ant:nb-javac] import sun.beans.editors.BoolEditor;
[ant:nb-javac] ^
[ant:nb-javac] D:_Programming_JMonkeyEngine\sdk\jme3-gui\src\com\jme3\gde\gui\nodes\GElementNode.java:26: error: package sun.beans.editors does not exist
[ant:nb-javac] import sun.beans.editors.BooleanEditor;
[/java]

Not yet sure where that is comming from… going to look if there would be another option for the bullet issue

@zzuegg said: Okay, the workaround for "bullet is the same as described above.

Regarding the sdk build:

The file generated contained:
[java]
nbplatform.default.netbeans.dest.dir=D:_Programming_JMonkeyEngine
etbeans
nbplatform.default.harness.dir=D:_Programming_JMonkeyEngine
etbeans/harness
[/java]

It could be because of my underscore directory names, but i had to change the file to:

[java]
nbplatform.default.netbeans.dest.dir=D:/_Programming/_JMonkeyEngine/netbeans
nbplatform.default.harness.dir=D:/_Programming/_JMonkeyEngine/netbeans/harness
[/java]

Now it seems to resolve all correctly, but i still get some erros:
[java]
[ant:nb-javac] D:_Programming_JMonkeyEnginesdkjme3-guisrccomjme3gdegui
odesGElementNode.java:25: error: package sun.beans.editors does not exist
[ant:nb-javac] import sun.beans.editors.BoolEditor;
[ant:nb-javac] ^
[ant:nb-javac] D:_Programming_JMonkeyEnginesdkjme3-guisrccomjme3gdegui
odesGElementNode.java:26: error: package sun.beans.editors does not exist
[ant:nb-javac] import sun.beans.editors.BooleanEditor;
[/java]

Not yet sure where that is comming from… going to look if there would be another option for the bullet issue

Funny issue, normally back and forward slashes should be converted to the correct ones for the system by ANT, might be because now ANT is invoked from gradle.

Might be the gui editor still has some imports missing, it was merged from a PR but not compatible to the build, I thought I fixed all of them with the last commits though, gonna check that again, thanks.

Just for your info and maybe it helps someone. This guide is working well:

https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:build_jme3_sources_with_netbeans

Everything builds and starting the tests results in the jme-startup windows. For my badness, nothing runs jet, cause it needs GLIBC_2.14 for libbulletjme64.so (even if the test sounds not like a bullet one). Wheezy, is using an older glibc version. I try to fix it later.

Edit: Netbeans 8.0.1

@zzuegg said: Now it seems to resolve all correctly, but i still get some erros: [java] [ant:nb-javac] D:_Programming_JMonkeyEnginesdkjme3-guisrccomjme3gdegui odesGElementNode.java:25: error: package sun.beans.editors does not exist [ant:nb-javac] import sun.beans.editors.BoolEditor; [ant:nb-javac] ^ [ant:nb-javac] D:_Programming_JMonkeyEnginesdkjme3-guisrccomjme3gdegui odesGElementNode.java:26: error: package sun.beans.editors does not exist [ant:nb-javac] import sun.beans.editors.BooleanEditor; [/java]

Not yet sure where that is comming from… going to look if there would be another option for the bullet issue

Can’t reproduce this issue, are you by any chance compiling with JDK8 or something? And you do use the netbeans platform that the build script downloads?

Yeah to JDK8.
And the error happens if i launch the script from intellij and from the downloaded netbeans (Just launching the Build-Target from the Build Script right?)

Actually, the lines throwing the error are marked as “Unused imports” if i remove the imports it compiles and launches without erros. Not yet tested that donededitor however.

removing GElementNode.java line 24-26

@zzuegg said: Actually, the lines throwing the error are marked as "Unused imports" if i remove the imports it compiles and launches without erros. Not yet tested that donededitor however.

removing GElementNode.java line 24-26

The editor doesn’t work yet because of its dependency on a snapshot version of Nifty. But it should compile, at least in normal gradle. I’ll remove those imports then.

[java]BUILD SUCCESSFUL[/java]

Gradle 2.1 only had the problem with the 2 imports, as I posted earlier. Thanks for pointing out that they were unused and also for removing them in master.

I am fully aware of what a development version is. But what if I want to look at how the cake is made and learn from it?