日志类的JAVA_HOME问题

时间:2012-07-05 15:30:10

标签: java logging java-home

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

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

C:\ jdk1.6.0_31




我没有进行任何日志记录我只是在我的类路径上有以下依赖项(ALONGWITH THE 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)

1 个答案:

答案 0 :(得分:1)

您是不是要在代码中的某处清理/设置系统属性?如果找不到java.util.logging.LogManager.readConfiguration系统属性,则java.home会抛出此错误。

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