Created
January 12, 2012 16:38
-
-
Save rchavarria/1601499 to your computer and use it in GitHub Desktop.
Cargar y abrir librería Tibrvj, http://rchavarria.wordpress.com/2012/01/13/tibrvexceptionerror901messagelibrary-not-found-tibrvj/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.tibco.tibrv.Tibrv; | |
import com.tibco.tibrv.TibrvException; | |
public class TibrvLoaderTest { | |
public static void main(String[] args) { | |
new TibrvLoaderTest().start(); | |
} | |
private void start() { | |
printClasspath(); | |
printLibraryPath(); | |
testLoadLibrary(); | |
openTibrvjLibrary(); | |
} | |
private void printClasspath() { | |
String cp = System.getProperty("java.class.path"); | |
for(String cpElement : cp.split(";")){ | |
System.out.println("Classpath element: " + cpElement); | |
} | |
} | |
private void printLibraryPath() { | |
String lp = System.getProperty("java.library.path"); | |
for(String lpElement : lp.split(";")){ | |
System.out.println("Library path element: " + lpElement); | |
} | |
} | |
private void testLoadLibrary() { | |
System.loadLibrary("tibrvj"); | |
} | |
private void openTibrvjLibrary() { | |
try { | |
Tibrv.open(Tibrv.IMPL_NATIVE); | |
} catch (TibrvException e) { | |
throw new RuntimeException("Can't load Tibrv", e); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment