开发者

Using {@link classname} for external API in my class

开发者 https://www.devze.com 2023-02-20 18:23 出处:网络
I have the following: package test.tester; import org.apache.log4j.Logger; public class tester { private static Logger logger = Logger.getLogger(tester.class);

I have the following:

package test.tester;

import org.apache.log4j.Logger;

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

    /**
     * {@link org.apache.log4j.Logg开发者_运维百科er}
     * 
     * @param args
     */
    public static void main(final String[] args) {
        logger.info("test");
    }
}

This is generating the links to the Logger class successfully, but the javadoc tooling complains like so:

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);
                    ^


I believe you should add the log4j library to Javadoc classpath when running it. Otherwise it can't know what it is.

0

精彩评论

暂无评论...
验证码 换一张
取 消