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

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
Alexander Ross

Alexander Ross

Gaming, Esports & Interactive Media Writer

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.

Share this article
Twitter Facebook Pinterest