这是代码:package mscontroller;import javax.swing.*;import com.apple.eawt.Application;public class Main { public static void main(String[] args) { Application app = new Application(); app.setEnabledAboutMenu(true); AMEListener listener = new AMEListener(); app.addApplicationListener(listener); JFrame mainFrame = new JFrame("Application Menu Example"); mainFrame.setSize(500, 500); mainFrame.setVisible(true); }}这是错误:Exception in thread "main" java.lang.Error: Unresolved compilationproblems: Access 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') Access restriction: The constructor 'Application()' is not API(restriction on required library'/Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/jre/lib/rt.jar') Access restriction: The type 'Application' is not API (restriction onrequired library'/Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/jre/lib/rt.jar') Access restriction: The method'Application.setEnabledAboutMenu(boolean)' is not API (restriction onrequired library'/Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/jre/lib/rt.jar') AMEListener cannot be resolved to a type AMEListener cannot beresolved to a type at mscontroller.Main.main(Main.java:9)eclipse说这个:访问限制:“应用程序”类型不是API(对必需库'/Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/jre/lib/rt.jar'的限制)
添加回答
举报
0/150
提交
取消