function updatejavastaticpath(jarsAdded)
% Copyright 2017 The MathWorks, Inc.
if ~isempty(jarsAdded)
    javaClass = javaArray('java.lang.Class', 1);
    javaClass(1) = java.lang.Class.forName('java.net.URL');
    loaderClass = java.lang.Class.forName('java.net.URLClassLoader');
    addUrlMethod = loaderClass.getDeclaredMethod('addURL', javaClass);
    addUrlMethod.setAccessible(true);
                
    sysClassLoader = java.lang.ClassLoader.getSystemClassLoader();
    objArray = javaArray('java.lang.Object', 1);
    for i=1:numel(jarsAdded)
        objArray(1) = java.io.File(jarsAdded{i}).toURI().toURL();
        addUrlMethod.invoke(sysClassLoader, objArray);
    end
end
end
