The import java.awt cannot be resolved

后端 未结 1 448
花落未央
花落未央 2020-12-06 07:56

I have installed the Eclipse [Version: Photon Release (4.8.0)] and JDK 10 on a MacBookPro with macOS 10.13.5 When I write in my code: import java.awt.*;

<
相关标签:
1条回答
  • 2020-12-06 08:37

    Is the java.awt included in JDK 10?

    Ye, the package does exist. The Java10 API docs do confirm the same as well.

    If yes where is and how can I make visible to Eclipse?

    In a modular code, all you need to do, is to resolve the java.desktop module by declaring a dependency on it in your module-descriptor file(module-info.java). i.e.

    requires java.desktop;
    
    0 讨论(0)
提交回复
热议问题