Eclipe LUNA - “The import java.sql cannot be resolved”

▼魔方 西西 提交于 2021-01-28 12:53:16

问题


I have Eclipse LUNA and JDK 8 installed on my computer. I get the message "The import java.sql cannot be resolved" on the import lines.

i checked the jre definition (windows -> reference -> java -> installed JREs and it is setup there to the folder of the jre on my computer.

what is the problem?


回答1:


Right click on project - >BuildPath - >Configure BuildPath - >Libraries tab - >

Double click on JRE SYSTEM LIBRARY - >Then select alternate JRE

Try this.. After that once clean your project too..




回答2:


You can also try declaring a dependency

requires java.sql;

on your module-descriptor file(module-info.java).




回答3:


It is my experience that workspaces do not always work correctly after upgrading Eclipse to a newer version.

Recreate your workspace from your version control system.



来源:https://stackoverflow.com/questions/24712858/eclipe-luna-the-import-java-sql-cannot-be-resolved

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!