1

I'm using Mac for the first time and I'm assuming this is a OS specific error, because the same code worked well on Ubuntu.

I'm trying to compile this code and Eclipse is showing me a lot of errors like this one:

Access restriction: The method invokeLater(Runnable) from the type SwingUtilities is not accessible due to restriction on required library /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/jre/lib/rt.jar

This is the first time I facing something like this and I don't know how to continue.

I'm using Java 8.

1
  • 1
    What usually works for me if something like this happens is to remove the JRE System Library from the project and then re-add it. Commented Jun 17, 2014 at 15:50

2 Answers 2

2

I honestly have no clue why this happens, and it's a pain when I can't remember how I fixed it last time. Some Eclipse quirk, I suppose.

I usually fix this by removing the JRE System Library from the build path and then adding it back.

Sign up to request clarification or add additional context in comments.

Comments

1

I guess is that Mac does not support System Trays. You should check if support exists using the method java.awt.SystemTray.isSupported(). Does this return true?

EDIT: I guess the problem is more at the Eclipse IDE level? Try reinstalling Java.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.