Java AWT package "not accessible" in eclipse [duplicate]

When I try and import the AWT package in eclipse by doing "import java.awt.*;" at the beginning of my code it comes up with an error that "The package java.awt is not accessible." java.util seems to work fine, but the awt package doesn't. I'm not sure what I need to do to make it "accessible".

5

1 Answer

You can fix it by following the following steps:

Go to: Project -> Properties -> Libraries -> Add Library -> Execution Environment

Select the drop down list and then choose "javaSE-1.7"

That solved the problem for me!

1

You Might Also Like