jMonkey Engine

The jMonkey Engine or jME is a Java-based game engine. jME uses  LWJGL as its rendering system, and as I noted yesterday, LWJGL is now supported on x86 systems running Solaris. 

However,  x86 support was a feature of the LWJGL 2.0 release. jME is still using LWJGL 1.4. Regardless, I was able to get jME to use LWJGL 2.1 w/out too much trouble following these steps:

Step 1: Install jME

  • Follow the jME Getting Started guide. Personally I followed the instructions for NetBeans. There are also instructions for Eclipse.

  • You'll get to a point where it's time to run the TestChooser, which will bring up a dialog like follows:



    However, trying to run any test should fail with:
    SEVERE: Exception in game loop
    java.lang.UnsatisfiedLinkError: /export/home/bleonard/NetBeansProjects/OpenGL/jme/lib/liblwjgl.so: ld.so.1: java: fatal: libm.so.6: open failed: No such file or directory
    

    This is because the LWJGL libraries that ship with jME are the ones for Linux, not Solaris. 

 Step 2: Update jME with the Solaris LWJGL

  • Create a solaris folder in the jme/lib directory.

  • Download and install LWJGL for Solaris x86.

  • Copy liblwjgo.so and libopenal.so from the lwjgl-2.1.0/native/solaris diretory to the jme/lib/solaris directory.

  • Edit the "run=testchooser" task in build.xml, appending "/solaris" to the java.library.path:
    <target name="run-testchooser" depends="compile-test" description="Runs the TestChooser">
    	<java classname="jmetest.TestChooser" fork="true" classpathref="classpath">
    		<jvmarg value="-Djava.library.path=${libs}/solaris" />
    	</java>
    </target>

  • Run the project again. This time when you attempt to run a test, it should fail with:
    SEVERE: Exception in game loop
    java.lang.LinkageError: Version mismatch: jar version is '12', native libary version is '17'
    This is because we're now using the native Solaris libraries that were bujilt with LWJGL 2.0, but the other LWJGL libraries are still the 1.4 ones. We need to update those as well.

  • Copy the jar files from lwjgl-2.1.0/jar to the jme/lib directory, effectively upgrading jME from LWJGL 1.4 to 2.1.

  • Run the project again. This time it won't even build - we're going backwards! The build errors are primarly due to the LWJGL's GLU class, which moved from one package to another. 

Step 3: Update jME to LWJGL 2.1

The build errors are easier to find and fix if you're using a tool like NetBeans. We first need to give NetBeans a bit more information about our project.
  • Open the project properties and set the Java Sources folder to src. Set the Java Sources Classpath to all the jars in the lib directory. Give NetBeans a moment while it scans your sources.

  • Once complete open the Tasks window and you should see a bunch of complaints that "package org.lwjgl.openal.glu does not exist".



    You can use these tasks to jump into the code and make the corrections. To fix the errors, you need to change all references of:
    org.lwjgl.opengl.glu.GLU
    to
    org.lwjgl.util.glu.GLU
  • After making the GLU corrections, there should be 3 errors remaining about in the LWJGLSystemProvider.java file about LWJGLInstaller, which has been deprecated. I haven't bothered figuring out yet how to update this code, so I've just commented it out for now.

  • Try running the code one final time.



  • To run the project quicker, remove the "compile-test" dependency from the "run-testchooser" task in build.xml. If you then make changes to the code, right-click the project and run "Test" before running the project again.

    Now onto experimenting with game development using jME...

Comments:

Hi,

does the above progress mean that I can play JME games in OpenSolaris? I think it is a market SUN must consider.

Posted by Vasileios Anagnostopoulos on April 11, 2009 at 04:35 AM GMT #

Yes, you can play jME games in OpenSolaris.

Posted by William Leonard on April 20, 2009 at 07:34 AM GMT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

The Observatory is a blog for users of Oracle Solaris. Tune in here for tips, tricks and more as we explore the Solaris operating system from Oracle.

Connect with Oracle Solaris:


Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
20
21
22
23
24
25
26
27
28
29
30
   
       
Today