3

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

Mirza Obaid
  • 1,707
  • 3
  • 23
  • 35
nantitv
  • 3,539
  • 4
  • 38
  • 61

1 Answers1

0

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.

Alex Karlsson
  • 296
  • 1
  • 11