本文介绍了无法运行简单的doclet程序:包com.sun.javadoc不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试运行一个简单的doclet程序,但是我无法对其进行编译.

I am trying to run a simple doclet program, but I am not able to compile it.

javac -cp /cygdrive/c/Progra~2/Java/jdk1.8.0_65/lib/tools.jar  A.java

但是会抛出

A.java在哪里

import com.sun.javadoc.ClassDoc;
public class A {
}

我是从

http://download.java.net/jdk7u2/docs/technotes/guides/javadoc/doclet/overview.html

我知道我在犯一个简单的错误,但我无法弄清楚.谁能指出我做错了什么

I know that I am doing a simple mistake but I ma not able to figure it out.Can anyone please point me out what am I doing wrong

推荐答案

您需要将Tools.jar添加到项目路径.它不包括在标准安装中.

You need to add Tools.jar to the project path. It is not included in the standard installation.

请问您为什么需要com.sun.javadoc?在大多数情况下,建议不要整体使用com.sun.

Can I ask why you need com.sun.javadoc? It is in most cases discouraged to use com.sun overall.

这篇关于无法运行简单的doclet程序:包com.sun.javadoc不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 14:06