private void loadLib(String name) throws NativeResourceException {

		String libName = name.substring(name.indexOf("lib")+3);
		try {
			if( isARM()) {
				//System.err.println("Attempting arm variants");
				for(int i=0;i<armLibs.length;i++) {
					try {
						inJarLoad(armLibs[i]);
						//System.err.println("Arm lib success! "+armLibs[i]);
						return;
					}catch(UnsatisfiedLinkError e) {
						//System.err.println("Is not "+armLibs[i]);
					}
				}
			}else {
				inJarLoad(name);
			}
			return;
		} catch (UnsatisfiedLinkError ex) {
			if( isOSX() ||  isLinux()){
				try{
					inJarLoad("libNRJavaSerial_legacy");
					//System.err.println("Normal lib failed, using legacy..OK!");
					return;
				}catch(UnsatisfiedLinkError er){
					ex.printStackTrace();
				}
			}else{
				ex.printStackTrace();
			}
			try{
				//check to see if the library is availible in standard locations
				System.loadLibrary(libName);
				testNativeCode();
				return;
			}catch(UnsatisfiedLinkError e){
				try{
					name = "rxtxSerial";
					//last ditch effort to load
					System.loadLibrary( name);	
					testNativeCode();
					return;
				}catch(UnsatisfiedLinkError err){
					//System.err.println("Failed to load all possible JNI local and from: \n"+System.getProperty("java.library.path"));
					ex.printStackTrace();
					throw new NativeResourceException("Unable to load deployed native resource");
				}
			}
			
		}
	}