I am trying to get jmonkey working from command line. Then eventually Intellij with the new alpha2 code
I have this as my build.gradle
apply plugin : 'java'
apply plugin : 'application'
mainClassName = "com.scriptblocks.jmonkeytest.Main"
repositories {
mavenCentral()
jcenter()
maven { url 'http://updates.jmonkeyengine.org/maven' }
maven { url 'https://jcenter.bintray.com/org/jmonkeyengine/'}
}
def jmonkeyengine_version = '3.1'
dependencies {
compile "com.jme3:jme3-core:$jmonkeyengine_version.+"
compile "com.jme3:jme3-effects:$jmonkeyengine_version.+"
compile "com.jme3:jme3-networking:$jmonkeyengine_version.+"
compile "com.jme3:jme3-plugins:$jmonkeyengine_version.+"
compile "com.jme3:jme3-jogg:$jmonkeyengine_version.+"
compile "com.jme3:jme3-terrain:$jmonkeyengine_version.+"
compile "com.jme3:jme3-blender:$jmonkeyengine_version.+"
compile "com.jme3:jme3-jbullet:$jmonkeyengine_version.+"
// compile "com.jme3:jme3-niftygui:$jmonkeyengine_version.+"
compile "com.jme3:jme3-desktop:$jmonkeyengine_version.+"
compile "com.jme3:jme3-lwjgl:$jmonkeyengine_version.+"
runtime "com.jme3:jme3-lwjgl:$jmonkeyengine_version.+"
}
and this as my only class file
package com.scriptblocks.jmonkeytest;
import com.jme3.app.SimpleApplication;
import com.jme3.material.Material;
import com.jme3.math.Vector3f;
import com.jme3.scene.Geometry;
import com.jme3.scene.shape.Box;
import com.jme3.math.ColorRGBA;
/**
* Created by gbluntzer on 3/13/2016.
*/
public class Main extends SimpleApplication {
public static void main(String[] args){
Main app = new Main();
app.start();
}
@Override
public void simpleInitApp() {
Box b = new Box(Vector3f.ZERO, 1, 1, 1);
Geometry geom = new Geometry("Box", b);
Material mat = new Material(assetManager,
"Common/MatDefs/Misc/Unshaded.j3md");
mat.setColor("Color", ColorRGBA.Blue);
geom.setMaterial(mat);
rootNode.attachChild(geom);
}
}
Two Questions
First, is the gradle build file correct? am I using the right value for def jmonkeyengine_version = ‘3.1’
Second question is the java code correct.
When I set the gradle value from 3.1 to 3.0 the application will launch and i will see the setup screen then the blue cube
When I use 3.1 it will also launch but nothing will be on screen not status text or blue cube and no error will be thrown.
Thanks for any help