


I called the method in question as a method of an object which inherited that method from a super class. is not API (restriction on required project). I've ran into a similar issue recently: Access restriction: The method. Now let's get to the error Eclipse reports. From what one can read from its source, you are rather expected to use the static instance returned by getApplication(). To begin with ( and unrelated), instantiating the Application class by yourself does not seem to be its intended use. "Add." a "Resolution: Accessible" with a corresponding rule pattern.įor me that was " javax/smartcardio/**", for you it might instead be " com/apple/eawt/**".Go to "Java Build Path", tab "Libraries".by selecting "Properties" from the context menu of the project in the "Package Explorer". Go to the properties of your Java project,.The solution is to change the access restrictions. In that case, we get this error in Eclipse. And there can be situations, where Eclipse is not really right (that's what happened to me, I just wanted to use javax.smartcardio). Now, there can be situations, where you want to use public Non-API, like sun.misc (you shouldn't, unless you know what you're doing). And Eclipse is usually right about what is and what isn't part of the public API. Usually, Eclipse is right about that, in both senses: We usually do not want to use something which is not part of the public API. Background: Eclipse access restrictionsĮclipse has a mechanism called access restrictions to prevent you from accidentally using classes which Eclipse thinks are not part of the public API. This happened to me as well, and the answers given here already were not satisfying, so I did my own research. 'tEnabledAboutMenu(boolean)' is not API (restriction onĪMEListener cannot be resolved to a type AMEListener cannot beĪccess restriction: The type 'Application' is not API (restriction on required library '/Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/jre/lib/rt.jar') '/Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/jre/lib/rt.jar')Īccess restriction: The constructor 'Application()' is not APIĪccess restriction: The type 'Application' is not API (restriction on Problems: Access restriction: The type 'Application' is not API Here is the error: Exception in thread "main" : Unresolved compilation JFrame mainFrame = new JFrame("Application Menu Example") AMEListener listener = new AMEListener()
