Is the Java classpath final after JVM startup?

后端 未结 7 568
灰色年华
灰色年华 2021-02-02 11:11

I have read a lot about the Java class loading process lately. Often I came across texts that claimed that it is not possible to add classes to the classpath during runtime and

7条回答
  •  北海茫月
    2021-02-02 11:50

    I believe that the classpath is taken to be static and the result of changing the files is undefined.

    If you really want to be able to add and remove classes at runtime, consider doing so in your own classloader. This is what web containers do.

提交回复
热议问题