private void createClassLoader ( ) { if ( ! Utils . isNullOrEmpty ( settings . getJarFiles ( ) ) ) { try { String [ ] files = settings . getJarFiles ( ) . split ( ";" ) ; List < URL > urls = newArrayList ( ) ; for ( String path : files ) { File file = new File ( path ) ; if ( file . isFile ( ) ) { urls . add ( file . toURI ( ) . toURL ( ) ) ; } } classLoader = new Java4CppClassLoader ( urls . toArray ( new URL [ files . length ] ) , classLoader ) ; } catch ( Exception e ) { throw new RuntimeException ( "Failed to load jar " + e . getMessage ( ) ) ; } } }
Construct the context class loader by adding all jars .