Custom Java classloader not being used to load dependencies?

后端 未结 5 1183
逝去的感伤
逝去的感伤 2021-02-05 10:28

I\'ve been trying to set up a custom classloader that intercepts classes to print out which classes are being loaded into the application. The classloader looks like this

<
5条回答
  •  感情败类
    2021-02-05 11:01

    You can use the PySystemState object to specify a custom class loader before you instantiate the PythonInterpreter.

    PySystemState state = new PySystemState();
    state.setClassLoader(classLoader);
    PythonInterpreter interp = new PythonInterpreter(table, state);
    

    http://wiki.python.org/jython/LearningJython

提交回复
热议问题