Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我尝试通过执行“import java.awt.*;”在 Eclipse 中导入 AWT 包时 在我的代码的开头,它出现了“无法访问包 java.awt”的错误。java.util 似乎工作正常,但 awt 包没有。我不确定我需要做什么才能使其“可访问”。
您可以按照以下步骤修复它:
转到:项目->属性->库->添加库->执行环境
选择下拉列表,然后选择“javaSE-1.7”
这为我解决了问题!