Not able to run a simple doclet program : package com.sun.javadoc does not exist

前提是你 提交于 2019-12-24 05:43:48

问题


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

But it throws

A.java:1: error: package com.sun.javadoc does not exist import com.sun.javadoc.ClassDoc;

Where A.java is

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

I referred it from

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


回答1:


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

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



来源:https://stackoverflow.com/questions/40804419/not-able-to-run-a-simple-doclet-program-package-com-sun-javadoc-does-not-exist

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