Odejava natives?

Is there a problem with the odejava natives on CVS?



I tried to update from CVS and despite compiling the java jmephysics classes properly, the natives don't seem to be working. I put the old natives again and then at least in Mac OSX they worked, but are quite unstable. The windows natives are not working for me at all anymore.



Irrisor, where should I download the odejava project for native compilation?



Useful information:

JME Version: Latest CVS



Mac OSX 10.4.10 - Intel core 2 duo, GMA 950

Windows XP Sp2 - Athlon 64, ATI X800

what kind of problem do you have with them?

i am using the latest jme und jmephysics and i didn't have any problems.



i'm on windows

The magic word here is: Linux.  :smiley: Maybe you should check out an older revision?

Windows and Linux are working fine over here. MacOSX was reported ok, in another thread, too.

I'll try to checkout a new project from CVS so. Maybe is a local issue here…

Irrisor…



Here it is… I got a fresh checkout from jme-physics CVS and the test don't run. I put all the natives (including libodejava.jnilib from the impl folder) in my proper native lib and I get this error:


SEVERE: Native code library (32 and 64 bit library) failed to load: java.lang.UnsatisfiedLinkError: ODEJAVA_VERSION_get
java.lang.UnsatisfiedLinkError: ODEJAVA_VERSION_get
   at org.odejava.ode.OdeJNI.ODEJAVA_VERSION_get(Native Method)
   at org.odejava.ode.OdeConstants.<clinit>(OdeConstants.java:12)
   at org.odejava.Odejava.getLibraryVersion(Odejava.java:127)
   at org.odejava.Odejava.<clinit>(Odejava.java:87)
   at com.jmex.physics.impl.ode.OdePhysicsSpace.<init>(OdePhysicsSpace.java:307)
   at com.jmex.physics.impl.ode.OdePhysicsSpace$OdeFactory.create(OdePhysicsSpace.java:196)
   at com.jmex.physics.PhysicsSpace.create(PhysicsSpace.java:326)
   at com.jmex.physics.util.SimplePhysicsGame.initSystem(SimplePhysicsGame.java:90)
   at com.jme.app.BaseGame.start(BaseGame.java:65)
   at com.jmetest.physics.TestVehicle.main(TestVehicle.java:115)
23/Ago/2007 0:30:25 class com.jmetest.physics.TestVehicle start()
SEVERE: Exception in game loop
java.lang.UnsupportedOperationException: Failed to load natives
   at org.odejava.Odejava.init(Odejava.java:117)
   at com.jmex.physics.impl.ode.OdePhysicsSpace.<init>(OdePhysicsSpace.java:307)
   at com.jmex.physics.impl.ode.OdePhysicsSpace$OdeFactory.create(OdePhysicsSpace.java:196)
   at com.jmex.physics.PhysicsSpace.create(PhysicsSpace.java:326)
   at com.jmex.physics.util.SimplePhysicsGame.initSystem(SimplePhysicsGame.java:90)
   at com.jme.app.BaseGame.start(BaseGame.java:65)
   at com.jmetest.physics.TestVehicle.main(TestVehicle.java:115)
Caused by: java.lang.UnsatisfiedLinkError: ODEJAVA_VERSION_get
   at org.odejava.ode.OdeJNI.ODEJAVA_VERSION_get(Native Method)
   at org.odejava.ode.OdeConstants.<clinit>(OdeConstants.java:12)
   at org.odejava.Odejava.getLibraryVersion(Odejava.java:127)
   at org.odejava.Odejava.<clinit>(Odejava.java:87)
   ... 6 more



It works if I keep only the old native libodejava.jnilib
Maybe you forgot to send the new odejava-jni.jar or something...

That is on MacOSX. I'll test on windows later

what means "old"?

The file libodejava.jnilib I already had before the last CVS Update. But that one is not stable, keeps crashing when some fast collisions happen some times.



Looks like the odejava-jni is trying to access some function that is not present in this old lib (the one that at least works).



The thing is: If I get the jmephysics project from CVS I can't run the tests because of the error I described on the last post.

Well the MacOSX natives were compiled by a forum user and I checked that file in. If it's not working we need someone else to compile it :expressionless:

I can do it. I just didn't manage to get everything because I found it a bit confusing. I checked the odejava project from the CVS but don't know where I should get the ode binaries or whatsoever.



I'll try again.

Great that you want to try again :slight_smile:



You can find ode svn information on ode.org:  svn co https://opende.svn.sourceforge.net/svnroot/opende opende



Have a look at odejava-jni/src/readme.txt on how to build the natives.

I think I have the same problem I think. This is my error code.



Sep 9, 2007 7:46:54 PM org.odejava.Odejava <clinit>

SEVERE: Native code library (32 and 64 bit library) failed to load: java.lang.UnsatisfiedLinkError: no odejava in java.library.path

java.lang.UnsatisfiedLinkError: no odejava in java.library.path

at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)

at java.lang.Runtime.loadLibrary0(Runtime.java:822)

at java.lang.System.loadLibrary(System.java:992)

at org.odejava.Odejava.<clinit>(Odejava.java:86)

at com.jmex.physics.impl.ode.OdePhysicsSpace.<init>(OdePhysicsSpace.java:307)

at com.jmex.physics.impl.ode.OdePhysicsSpace$OdeFactory.create(OdePhysicsSpace.java:196)

at com.jmex.physics.PhysicsSpace.create(PhysicsSpace.java:330)

at com.jmex.physics.util.SimplePhysicsGame.initSystem(SimplePhysicsGame.java:90)

at com.jme.app.BaseGame.start(Unknown Source)

at BlockGame.main(BlockGame.java:263)

Sep 9, 2007 7:46:54 PM class BlockGame start()

SEVERE: Exception in game loop

java.lang.UnsupportedOperationException: Failed to load natives

at org.odejava.Odejava.init(Odejava.java:123)

at com.jmex.physics.impl.ode.OdePhysicsSpace.<init>(OdePhysicsSpace.java:307)

at com.jmex.physics.impl.ode.OdePhysicsSpace$OdeFactory.create(OdePhysicsSpace.java:196)

at com.jmex.physics.PhysicsSpace.create(PhysicsSpace.java:330)

at com.jmex.physics.util.SimplePhysicsGame.initSystem(SimplePhysicsGame.java:90)

at com.jme.app.BaseGame.start(Unknown Source)

at BlockGame.main(BlockGame.java:263)

Caused by: java.lang.UnsatisfiedLinkError: no odejava in java.library.path

at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)

at java.lang.Runtime.loadLibrary0(Runtime.java:822)

at java.lang.System.loadLibrary(System.java:992)

at org.odejava.Odejava.<clinit>(Odejava.java:86)

… 6 more



It is a little different. I only get this error code when I have odejava-jni.java in the has a library. If I don't have it I get another error code. I am using the jme-physics.jar build from jMEphysics. And odejava-jni.java from the jMEphysics download. I have added libodejava.jnilib too. I does not matter which combination I use. Can I maybe get some simple directions :smiley: or could some one post it in the Wiki?

What OS do you have? You need the natives coming from CVS when you use the sources from CVS. What do you mean with 'the download'?

Also did you point java to the correct location of the natives? (-Djava.library.path=yourlibfolder)



And I can't understand this sentence :?

cyberknight said:

I only get this error code when I have odejava-jni.java in the has a library.

Irrisor,



Some additional words about the issues I was having:

1 - The instability in windows was due to the

Odejava.setMaxContactsPerNearcallback(int value)


  • Using 200 it causes instantaneous crash in my WinXP SP2 (Athlon 64 3000+) and not so imediate, but also quite often, in Mac OSX 10.4.10.
  • Getting it back to 50 (and now 35) solved the problem, and since I solved the numerical instabilities with other tweekings, that

I am using Mac OS X 10.4.10. This is the download https://jmephysics.dev.java.net/servlets/ProjectDocumentList?folderID=7985. I am new to Eclipse and don’t know how to set  the java.library.path in it. And perick is right about the what I meant. I had this problem because when I build jMEphysics it doesn’t create the odejava-jni.jar.

Thanks for helping.

You don't need to compile odejava-jni.jar, it's part of the odejava distribution and the version Irrisor put in the rc1 release you're downloading is OK. You just have to put ALL the jars, including jme's and physics's ones and those from the dependencies, like odejava and lwjgl in the classpath of your Eclipse project.



1 - If you don't bother having a lot of jars on the package explorer, just copy them in some folder inside your project and add them to the build path by clicking with the right button and following this menus: [buildpath] -> [add to buildpath].



2 - About the library path:

  • Go to preferences [windows] -> [preferences];
  • Select [java] -> [installed jres];
  • Choose the active JRE and click on EDIT at the right side of the window;
  • Type this in the [Default VM arguments] box: -Djava.library.path=“lib” (lib is the folder inside the project where the native libs reside)



    And voila, now you just have to use this same folder name (lib) for the natives in all your projects and not worry about this issue anymore.



    3 - The native library that is working for me can be downloaded from here:

    http://joh.deworks.net/dump/libodejava.jnilib



    It’s been compiled by another user, Joh, and the related topic can be seen here:

    http://www.jmonkeyengine.com/jmeforum/index.php?topic=4935.0

perick, the jnilib from cvs and in rc1 is still not working? (thought I replaced with the one from Joh).

I didn't try your RC1 yet, because I'm near my deadline and afraid of changes at this moment. But since I can allways recompile the working version I have here (1 month old CVS I think) I'll give it a try. If you replaced with Joh's lib I think it should work. With the last post I think cyberknight can get it working.

I got it to work a different way. It has been staring me in the face. In user libraries if you expand your jMEphysics and expand odejava-jni.jar there is a native library option. You simply edit it and browse to your lib folder. This is a picture of it http://home.earthlink.net/~brooks486o/NativeLibrary.jpg. I hope some one will put it in the Wiki.

Thanks perrick and

Good luck irrisor.

cyberknight said:

I hope some one will put it in the Wiki.

It's already in the current article (Step 9) :)