[ODEjava] integrating ODEjava in Eclipse-Project

Hi all,

I’m sorry that I have to ask for the installing of ODEjava, too. But I couldn’t find an answer for my problem.

I’d like to extend a Java3D system with ODEjava (Windows). My IDE is Eclipse. I have downloaded the .dll and the .jar and added them to my workspace. Then I have added the .jar to my classpath.

If I start the program, I get an UnsatisfiedLinkError. So I think that the c++ part (ODE) will not be found.

What have I forgotten?

Bye
Ramona

when you are running the program from eclipse. Go to Run > Run…

Then click new, it should come up with your class. Now go to the tab labled “(x)= Arguments” and in the VM arguments text field, type:


-Djava.library.path="./lib/";

This assumes you have your odejava.dll in a folder called lib in the project space.

And thats it, it should run :slight_smile:

DP

when you are running the program from eclipse. Go to Run > Run…

Then click new, it should come up with your class. Now go to the tab labled “(x)= Arguments” and in the VM arguments text field, type:


-Djava.library.path="./lib/";

This assumes you have your odejava.dll in a folder called lib in the project space.

And thats it, it should run :slight_smile:

DP

I tried this before, but it didn’t helps. I added the odejava.dll folder ${workspace_loc:lib/ode/20041030/win32/x86} to th arguments.

So my VM arguments looks like this now:

-Xmx256m -Djava.library.path="${workspace_loc:lib/java3d/1.3.1/win32/x86};${workspace_loc:lib/ode/20041030/win32/x86}"

So there must be another problem.

${workspace_loc:lib/ode/20041030/win32/x86} is an eclipse variable that eclipse will understand. The JVM will not understand that.

Say you have the following folder heirarchy:

workspace --> ProjectX --> src --> com --> projectX…
–> bin --> com --> projectX
–> data --> textures --> Hello.jpg
–> lib --> odejava.dll

              --> ProjectY --> ....

Can you see where you need to place the odejava.dll now? And do this:

-Djava.library.path="./lib/";

DP

After your answer I also tried it with

-Djava.library.path="./lib/";

But it doesn’t work.

And I understand your comment to the eclipse variable. But I think it should work, because $workspace_loc returns only the absolute file system path of the workspace root and not of the project. And “lib” is the project.

Anyway, it also works for java3d:

-Djava.library.path="${workspace_loc:lib/java3d/1.3.1/win32/x86}

Why shouldn’t it work with odejava?

Personally, I cheat and add native libaries to my system’s Java Library Path.

[if you need, there’s a bit of info about this under “Discovering the correct paths.” in this doc: http://xith.org/Installing]

Works great :slight_smile:

Will.

Thanks for your suggestion, but I’m sorry that I still have to say: It doesn’t work.

My system’s Java Library Path is:

Native Library path(s): C:\Documents and Settings\Moni\My Documents\Diplomarbeit\Implementierung\Impl 3\lib\java3d\1.3.1\win32\x86;C:\Documents and Settings\Moni\My Documents\Diplomarbeit\Implementierung\Impl 3\lib\ode\20041030\win32\x86

And the odejava.dll is in the folder:

C:\Documents and Settings\Moni\My Documents\Diplomarbeit\Implementierung\Impl 3\lib\ode\20041030\win32\x86

I also copied it to my “jre/bin”-folder, but it doesn’t help.

Maybe the problem is another. So here is the exception I get:

java.lang.UnsatisfiedLinkError: dWorldCreate
      at org.odejava.ode.OdeJNI.dWorldCreate(Native Method)
      at org.odejava.ode.Ode.dWorldCreate(Ode.java:526)
      at org.odejava.World.<init>(World.java:112)
      at core.view.java3d.loader.Java3dLoader.loadScene(Java3dLoader.java:103)
      at region.view.java3d.Java3dRModelView$ModelUpdater.run(Java3dRModelView.java:85)
      at java.lang.Thread.run(Thread.java:534)

Maybe I misinterpreted this exception. I hope somebody can help me!

That is a very unusual java native path. “My Documents” huh?

Perhaps my shortcut won’t be a short cut for you. You could try the more standard locations though like C:\Windows\System32.

I believe you have interperated the error correctly, it can’t find the native library.

Will.

Oh I know this is an very unusual path. The path looks like this because of the VM arguments of the Eclipse project (see above). Because different person works on this project and everybody has another location to save their workspaces, the native libraries are located in the workspace and the VM arguments are setted this way.

Anyway I will try your new suggestion. I’m just happy when I can start programming.

I tried it out with different standard locations, e.g. C:\Windows\System32 and C:\j2sdk1.4.2_06\bin.

But it didn’t work, too.

I continue trying various things. But if anybody has another idea, I’ll appreciate.

:slight_smile: I’ve got the solution to my problem. :slight_smile:

My Java Library Path is okay. I only forgot to load the library with:

System.loadLibrary("odejava");

oh dear.

Well done on solving your problem.

Do you want to add a new entry to the Odejava FAQ describing this error and the solution so others are saved the time?

Cheers,

Will.

Of course I can write a new entry about this problem. What do I have to do?
I have just registered to the odejava.org-homepage.

when logged in, on the FAQ page, click the "Show suggested questions/suggest a question " link at the bottom of the page.

Thanks!

Will.