if (!env.silent) {
String errors = "";
for (String id : env.getErroredFiles()) {
errors += id + " > " + env.getEnvSourceFile(id) + File.pathSeparator + " ";
}
throw new JXAException(JXAException.LEVEL.SYSTEM, (libpath ? "Native libraries" : "Jar resources") + " environment loading process had one or more errors." + Console.newLine + "Set jxa.debugSys=true jxa.debugECL=true to see more info. " + Console.newLine + errors);
}
} else if (libpath) {
synchronized (extsMap) {
ClassLoader cL = _switchToClassLoader(env.getEnvClassLoader());
for (String id : extsMap.keySet()) {
if (!((Map<URL, Boolean>) extsMap.get(id)).values().iterator().next()) {
continue;
}
try {
if (_debugSys) {
System.out.print("System.loadLibrary " + id);
}
System.loadLibrary(id);
if (_debugSys) {
System.out.println(" OK");
}
} catch (Throwable e) {
if (_debugSys) {
System.out.println(" FAILED " + e.getMessage());
}
String fullPath = env.getEnvInstalledFile(id).getAbsolutePath();
if (_debugSys) {
System.out.print("System.load library " + id + " from " + fullPath);
}
try {
System.load(fullPath);
if (_debugSys) {
System.out.println(" OK");
}
} catch (Throwable ex) {
if (_debugSys) {
System.out.println(" FAILED " + ex.getMessage());
}
if (!env.silent) {
throw new JXAException(e.getLocalizedMessage(), ex);
}
}
}
}
_switchToClassLoader(cL);