在 linux 机器上运行 jar 文件时,我得到以下堆栈跟踪。但是它在Windows机器上完美运行
Exception in thread "Thread-0" java.lang.NoClassDefFoundError: com/sun/servicetag/UnauthorizedAccessException
at com.montior.activemq.util.MQProperty.loadProperties(MQProperty.java:31)
at com.montior.activemq.util.MonitorThread.loadProperties(MonitorThread.java:82)
at com.montior.activemq.util.MonitorThread.run(MonitorThread.java:39)
at java.lang.Thread.run(Thread.java:679)
Caused by:java.lang.ClassNotFoundException:com.sun.servicetag.UnauthorizedAccessException
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
... 4 more
这是我的 loadProperies() 方法
public static void loadProperties() throws FileNotFoundException,IOException,ArgumentMissingException {
props=new Properties();
// load a properties file
String path = "./util.properties";
props.load(new FileInputStream(new File(path)));
ActiveMqClient.readProperties(props);
}
任何人都可以帮我解决这个例外吗?