2

即使我的 JAVA_HOME 设置正确,我也会收到以下错误。

C:\workspace-sts-2.8.0.RELEASE\JBClient\target>echo %JAVA_HOME%

C:\jdk1.6.0_31




我没有做任何日志记录我只是在我的类路径上有以下依赖项(连同 JRE)

 - concurrent.jar 
 - hornetq-core-client-java5.jar
 - hornetq-jms-client-java5.jar 
 - jboss-aop-client.jar
 - jboss-aspect-jdk50-client.jar jboss-client.jar jboss-common-core.jar
 - jboss-ejb3-common-client.jar jboss-ejb3-core-client.jar
 - jboss-ejb3-proxy-impl-client.jar jboss-ejb3-proxy-spi-client.jar
 - jboss-ejb3-security-client.jar jboss-integration.jar jboss-javaee.jar
 - jboss-logging.jar jboss-remoting.jar jboss-security-spi.jar
 - jbossall-client.jar jbosssx-client.jar jnp-client.jar

Exception in thread "main" java.lang.Error: Can't find java.home ??
    at java.util.logging.LogManager.readConfiguration(Unknown Source)
    at java.util.logging.LogManager$2.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.util.logging.LogManager.readPrimordialConfiguration(Unknown Source)
    at java.util.logging.LogManager.getLogManager(Unknown Source)
    at java.util.logging.Logger.<init>(Unknown Source)
    at java.util.logging.LogManager$RootLogger.<init>(Unknown Source)
    at java.util.logging.LogManager$RootLogger.<init>(Unknown Source)
    at java.util.logging.LogManager$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.util.logging.LogManager.<clinit>(Unknown Source)
    at java.util.logging.Logger.getLogger(Unknown Source)
    at com.sun.jmx.remote.util.ClassLogger.<init>(Unknown Source)
    at javax.management.remote.JMXServiceURL.<clinit>(Unknown Source)
    at main.java.JBClient.main(Unknown Source)
Exception in thread "Thread-0" java.lang.NoClassDefFoundError: Could not initialize class java.util.logging.LogManager
    at java.util.logging.LogManager$Cleaner.run(Unknown Source)
4

1 回答 1

1

您不是在代码中较早的地方清理/设置系统属性吗?java.util.logging.LogManager.readConfiguration如果找不到java.home系统属性,则会引发此错误。

检查这个答案- 虽然不是完全重复(类不同),但它似乎是同一种问题。

于 2012-07-05T15:45:42.397 回答