2011-03-28 51 views
0

我有以下幾點:使用{@link類名}外部API在我

package test.tester; 

import org.apache.log4j.Logger; 

public class tester { 
    private static Logger logger = Logger.getLogger(tester.class); 

    /** 
    * {@link org.apache.log4j.Logger} 
    * 
    * @param args 
    */ 
    public static void main(final String[] args) { 
     logger.info("test"); 
    } 
} 

這是生成的鏈接,成功的Logger類,但javadoc的工具抱怨像這樣:

Constructing Javadoc information... 
tester.java:3: package org.apache.log4j does not exist 
import org.apache.log4j.Logger; 
        ^

tester.java:6: cannot find symbol 
symbol : class Logger 
location: class test.tester.tester 
private static Logger logger = Logger.getLogger(tester.class); 
        ^

回答

1

我相信你應該在運行它時將log4j庫添加到Javadoc類路徑中。否則它不知道它是什麼。

+0

謝謝! -classpath工作。 – wulfgarpro 2011-03-28 10:51:16