Use the sun. * Classes in an Eclipse Java project

I was sent some Java code that uses classes in a package sun.awt.shellthat is not part of the JDK open API, so Eclipse will not compile the project:

Access restriction: the getIcon (boolean) method of the ShellFolder type is not available due to the restriction on the required library /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Classes/classes.jar

As long as I agree with this feeling, can I get Eclipse to compile it?

+3
source share
1 answer

Window -> Preferences -> Java -> Compiler -> Errors/Warnings " API" " " " " "".

+10

Source: https://habr.com/ru/post/1771921/


All Articles