Import com.sun.javadoc cannot be allowed in Eclipse

I have a problem compiling a project in Eclipse.

The import com.sun.javadoc cannot be resolved 

I added tools.jar as an external banner, changed the default compiler to use jdk instead of jre, made Project -> Clean afterwards. But none of this helped. What am I missing here?

UPD: how it looks (packages exist on the left, but do not appear on the right): alt text http://3593.iz.piccy.info.nyud.net/i5/93/35/353593/lol.gif

+4
source share
2 answers

There is a typo. If you are trying to run javadoc programmatically , you need to use

com.sun.tools.javadoc.Main

but not

com.sun.javadoc.Main.

+1
source

Probably because the bank you are importing has restriction rules.

You can disable them by disabling them. Either globally, or simply on the desired project.

It should be something like: -

  • Right click on the project
  • Select "Project Properties"
  • Select the Java Compiler-> Error / Warnings page
  • Enable project specific settings
  • Deprecated and restricted API-> Forbidden Directory (access rules). ---> set to ignore
+2
source

All Articles