Question

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?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top