Oculus Rift, a simple example in java failing

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 extraction of JRiftLibrary64.dll and adding its path to java path

System.loadLibrary ("JRiftLibrary64");

It works .. why doesn’t it work on the other hand?

+3
source share
1 answer

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

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

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

Hi

+1

All Articles