我已将 java.management 模块添加到我的构建路径中:
Java Build Path -> Libraries -> Modulepath -> Is modular -> Edit
我有这个问题:
InstanceAlreadyExistsException
MBeanRegistrationException
NotCompliantMBeanException
MalformedObjectNameException
如果我查看这些来源,它们都扩展了类路径(包含的模块)中的异常,并一直到实现 Throwable 的 java.lang.Exception。例如:
in javax.management InstanceAlreadyExistsException extends OperationsException
in javax.management OperationsException extends JMException
in javax.management JMException extends java.lang.Exception
in java.lang Exception implements Throwable
那么 InstanceAlreadyExistsException 到底怎么不是 Throwable 的子类呢? https://docs.oracle.com/javase/10/docs/api/javax/management/InstanceAlreadyExistsException.html