Loads ntcore from path if extracted load fails

There's a lot of buzz going around the internet about people trying to
get ntcore working on other devices. One of the things that makes it
harder is having to have a separate jar for each platform. What this
change does is if the loading of the extracted library fails, it will
attempt to load ntcore from the path. This means that a program like
GRIP can just provide the libntcore.so and not have to worry about
compiling different versions for different platforms.
This commit is contained in:
Thad House
2016-01-18 22:39:21 -08:00
parent c90a8c586f
commit 73d6e98bf2

View File

@@ -51,8 +51,11 @@ public class NetworkTablesJNI {
os.close();
is.close();
}
System.load(jniLibrary.getAbsolutePath());
try {
System.load(jniLibrary.getAbsolutePath());
} catch (UnsatisfiedLinkError e) {
System.loadLibrary("ntcore");
}
} else {
System.loadLibrary("ntcore");
}