private static DeepTagger makeDeepTagger(final File modelFolder) throws IOException { // Apparently this is the easiest way to set the library path in code... System.setProperty("java.library.path", "lib"); Field fieldSysPath; try { fieldSysPath = ClassLoader.class.getDeclaredField("sys_paths"); fieldSysPath.setAccessible(true); fieldSysPath.set(null, null); } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) { throw new RuntimeException(e); } return DeepTagger.make(modelFolder); }