在调试Tomcat的时候,System.getProperty("catalina.home")返回了一个目录
但是我在环境变量里面没有看到有这个变量,这个是怎么来的呢

解决方案 »

  1.   


    我是在单步debug时看到的,没有设置的,
        private void setCatalinaHome() {        if (System.getProperty("catalina.home") != null)
                return; // 在这里返回了
            File bootstrapJar = 
                new File(System.getProperty("user.dir"), "bootstrap.jar");
            if (bootstrapJar.exists()) {
                try {
                    System.setProperty
                        ("catalina.home", 
                         (new File(System.getProperty("user.dir"), ".."))
                         .getCanonicalPath());
                } catch (Exception e) {
                    // Ignore
                    System.setProperty("catalina.home",
                                       System.getProperty("user.dir"));
                }
            } else {
                System.setProperty("catalina.home",
                                   System.getProperty("user.dir"));
            }    }
      

  2.   

    找到原因了。是在Eclipse中设置了,这是以前设置的忘了,呵呵