3

I wrote this simple code:

public class Test {

    public static void main(String args[]) {

        OculusRift oculusRift = new OculusRift();        
        oculusRift.init();

        HMDInfo hdmInfo = oculusRift.getHMDInfo();
        System.out.println(hdmInfo);

//        while(oculusRift.isInitialized()){
//            
//        }

        oculusRift.destroy();
    }
}

But I get this error

Exception in thread "main" java.lang.UnsatisfiedLinkError: de.fruitfly.ovr.OculusRift._initSubsystem()Z
    at de.fruitfly.ovr.OculusRift._initSubsystem(Native Method)
    at de.fruitfly.ovr.OculusRift.init(OculusRift.java:82)
    at ec.test.test3.Test.main(Test.java:21)
Java Result: 1

I created and included a Library based on:

JRift-0.2.5.1.jar

JRiftLibrary-0.2.5.1.jar

JRiftLibrary-0.2.5.1-natives-windows.jar

From here

What is missing?

Edit:

Forced by extracting JRiftLibrary64.dll and adding its path explicitly to the java path

System.loadLibrary("JRiftLibrary64");

It works.. why does not work on the other way?

elect
  • 6,765
  • 10
  • 53
  • 119
  • I experienced exactly the same under Linux (so I had to copy the .so to the library path). Do you actually know whether there are sources available for this Rift wrapper? On first sight I though it is the same as [this](https://github.com/38leinaD/JRift/tree/master/JRift/src/de/fruitfly/ovr) (same namespace), but it looks like it has some more functionality. – bluenote10 Mar 08 '14 at 15:48
  • Unfortunately on this thematic there is a huge fragmentation, a lot of java ports sux, give a lot of problems and don't offer everything you need. The only one I found reliable looks to be the one from jherico, https://github.com/jherico/jocular – elect Mar 09 '14 at 11:53

1 Answers1

1

Have you tried JOVR? https://github.com/jherico/jovr

Here a complete example: https://github.com/jherico/jocular-examples

This library is simple, very solid and compatible with the current Oculus Runtime 1.8

Regards

Carlos Rafael Ramirez
  • 5,984
  • 1
  • 29
  • 36