在我的班级中使用 {@link classname} 作为外部 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);
^
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);
^
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信您应该在运行时将 log4j 库添加到 Javadoc 类路径中。否则它无法知道它是什么。
I believe you should add the log4j library to Javadoc classpath when running it. Otherwise it can't know what it is.