I’ve started to look at jME again, and have hit an issue when using the examples included in the Beginners Guide. I can import them without an issue, but they will not build or run. I get the following error…
warning: [options] bootstrap class path not set in conjunction with -source 1.6
D:\jMEProjects\JmeTests\src\jme3test\app\TestCloneSpatial.java:191: error: diamond operator is not supported in -source 1.6
Set<String> skipSet = new HashSet<>(Arrays.asList(skip));
(use -source 7 or higher to enable diamond operator)
D:\jMEProjects\JmeTests\src\jme3test\app\TestCloner.java:194: error: diamond operator is not supported in -source 1.6
private List<GraphNode> links = new ArrayList<>();
(use -source 7 or higher to enable diamond operator)
2 errors
1 warning
D:\jMEProjects\JmeTests\nbproject\build-impl.xml:521: The following error occurred while executing this line:
D:\jMEProjects\JmeTests\nbproject\build-impl.xml:219: Compile failed; see the compiler error output for details.
It doesn’t matter what newer JDK you have installed and running if you then tell it to compile for Java 6. It will happily try to do as you say and give you the error about using features that are only available in newer versions.
So, set your project settings to compile for a newer version and you’ll be fine. For whatever reason, the JME SDK defaults to Java 6.
I’ve gone back and had a look at this, and yes, the project was set for JDK6… swapped it for JDK7 and it complained about source 1.7 instead.
warning: [options] bootstrap class path not set in conjunction with -source 1.7
C:\Users\user\Documents\JmeTests\src\jme3test\bullet\PhysicsHoverControl.java:187: error: cannot access MotionState
getMotionState().applyTransform(spatial);
class file for com.bulletphysics.linearmath.MotionState not found
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\Users\user\Documents\JmeTests\src\jme3test\export\TestAssetLinkNode.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
1 warning
C:\Users\user\Documents\JmeTests\nbproject\build-impl.xml:521: The following error occurred while executing this line:
C:\Users\user\Documents\JmeTests\nbproject\build-impl.xml:219: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 1 second)
Then I checked it with JDK8
C:\Users\user\Documents\JmeTests\src\jme3test\bullet\PhysicsHoverControl.java:187: error: cannot access MotionState
getMotionState().applyTransform(spatial);
class file for com.bulletphysics.linearmath.MotionState not found
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\Users\user\Documents\JmeTests\src\jme3test\export\TestAssetLinkNode.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
C:\Users\user\Documents\JmeTests\nbproject\build-impl.xml:521: The following error occurred while executing this line:
C:\Users\user\Documents\JmeTests\nbproject\build-impl.xml:219: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 2 seconds)
This is all on a new install of JME, with no addons, or other projects etc…