Skip to content

Commit

Permalink
Fixed ARM library order.
Browse files Browse the repository at this point in the history
Fixes #47.
  • Loading branch information
mnlipp committed Mar 4, 2016
1 parent 86c5b3b commit c4f6b07
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/main/java/gnu/io/NativeResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ private void inJarLoad(String name)throws UnsatisfiedLinkError, NativeResourceEx
loadResource(resourceLocation);
testNativeCode();
}
private String[] armLibs = {"libNRJavaSerialv5","libNRJavaSerialv6_HF","libNRJavaSerialv6","libNRJavaSerial_HF","libNRJavaSerial"};
private String[] armLibs = {"libNRJavaSerial_HF","libNRJavaSerial","libNRJavaSerialv6_HF","libNRJavaSerialv6","libNRJavaSerialv5"};
private void loadLib(String name) throws NativeResourceException {

String libName = name.substring(name.indexOf("lib")+3);
Expand Down Expand Up @@ -139,7 +139,21 @@ private void loadResource(File resource) {
if(!resource.canRead())
throw new RuntimeException("Cant open JNI file: "+resource.getAbsolutePath());
//System.out.println("Loading: "+resource.getAbsolutePath());
try {
System.out.println("Going to load " + resource + ". Hit return...");
System.in.read();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.load(resource.getAbsolutePath());
try {
System.out.println("Loaded successfully, hit return...");
System.in.read();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

private void copyResource(InputStream io, File file) throws IOException {
Expand Down

0 comments on commit c4f6b07

Please sign in to comment.