use of org.strategoxt.IncompatibleJarException in project spoofax by metaborg.
the class StrategoRuntimeService method loadJars.
private void loadJars(HybridInterpreter runtime, Iterable<FileObject> jars) throws MetaborgException {
try {
final URL[] classpath = new URL[Iterables.size(jars)];
int i = 0;
for (FileObject jar : jars) {
final File localJar = resourceService.localFile(jar);
classpath[i] = localJar.toURI().toURL();
++i;
}
logger.trace("Loading jar files {}", (Object) classpath);
final ClassLoader classLoader = new StrategoRuntimeClassLoader(additionalClassLoaders);
runtime.loadJars(classLoader, classpath);
} catch (IncompatibleJarException | IOException | MetaborgRuntimeException e) {
throw new MetaborgException("Failed to load JAR", e);
}
}
Aggregations