"vtkIOImportJava",
};
-
-
- static {
- for (String lib : libs)
- System.loadLibrary(lib);
- }
-
- static void load() {
-
- }
+
+ private static boolean loaded = false;
+
+ static void load() {
+ if (!loaded) {
+
+ try {
+ Class.forName("java.awt.Toolkit");
+ } catch (ClassNotFoundException e) {
+ throw new IllegalStateException(e);
+ }
+ try {
+ System.loadLibrary("jawt");
+ } catch (UnsatisfiedLinkError e) {
+ // bypass potential load error. If jawt is not really loaded, we will get errors
+ // with VTK dlls.
+ }
+
+ for (String lib : libs)
+ System.loadLibrary(lib);
+
+ loaded = true;
+ }
+ }
}