Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » JDK12 - "com.sun.tools" not accessible
JDK12 - "com.sun.tools" not accessible [message #1818211] Tue, 10 December 2019 04:48 Go to next message
Eclipse UserFriend
I'm trying to import in Eclipse (2019-09 R (4.13.0)) a Maven project which uses the JDK 12 and makes use of classes from the com.sun.tools package.
Everything compiles fine, except for the classes from that package, which are found but not accessible (the compiler raises the error "The package com.sun.tools.javac.api is not accessible").
How to fix this?

Thanks
Re: JDK12 - "com.sun.tools" not accessible [message #1818242 is a reply to message #1818211] Tue, 10 December 2019 15:55 Go to previous message
Eclipse UserFriend
Oracle really doesn't want you to access classes in com.sun.tools.javac.api, the corresponding module-info for jdk.compiler declares:
    exports com.sun.tools.javac.api to
        jdk.javadoc,
        jdk.jshell;


Ergo, the package is accessible only to those two modules.

If you must break these rule (and take all responsibility on yourself), see:
- https://help.eclipse.org/2019-06/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Freference%2Fref-properties-build-path.htm&anchor=module-dependencies
- https://www.youtube.com/watch?v=UUQoQtKgaWc&list=PLy7t4z5SYNaT_yo5Dhajb9i-Pf0LbQ3z8&index=24

(look out for the parts about exports).
Stephan
Previous Topic:Cant start javascpirt project
Next Topic:openxmlformats schemas problem with indirect refrerence
Goto Forum:
  


Current Time: Thu Sep 18 09:53:00 EDT 2025

Powered by FUDForum. Page generated in 0.02942 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top