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

做~自己de王妃 提交于 2019-12-13 04:57:57

问题


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.Logger}
     * 
     * @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);
                    ^

回答1:


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



来源:https://stackoverflow.com/questions/5457840/using-link-classname-for-external-api-in-my-class

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!