*/
public class vtkJavaDep {
static String[] libs = new String[] {
- "jawt",
"vtksys",
"vtkCommonCore",
"vtkWrappingJava",
"vtkIOImportJava",
};
+
+ private static boolean loaded = false;
+ static void load() {
+ if (!loaded) {
- static {
- try {
- Class.forName("java.awt.Toolkit");
- } catch (ClassNotFoundException e) {
- throw new IllegalStateException(e);
- }
+ 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);
- }
-
- static void load() {
+ for (String lib : libs)
+ System.loadLibrary(lib);
+ loaded = true;
+ }
}
}