import java.lang.invoke.*; svoid javaLibraryPathHack() pcall { // hack for newer JDKs to accept a change java.library.path // see https://stackoverflow.com/questions/15409223/adding-new-paths-for-native-libraries-at-runtime-in-java // set sys_paths to null so that java.library.path will be reevalueted next time it is needed var cl = MethodHandles.privateLookupIn(ClassLoader.class, MethodHandles.lookup()); VarHandle sys_paths = cl.findStaticVarHandle(ClassLoader.class, "sys_paths", String[].class); sys_paths.set(null); }