“The type java.sql.Connection is not accessible” Eclipse IDE Error

huangapple go评论102阅读模式
英文:

"The type java.sql.Connection is not accessible" Eclipse IDE Error

问题

我在Stack Overflow上搜索了类似的错误,但并没有找到完全相同的情况。
我使用的是实际的OpenJDK,并且导入了实际的MySQL J连接器。

如果我尝试导入任何java.sql.*包,它会出现红色下划线,并且无法导入。

可能的原因是什么?

英文:

I searched stack overflow for similar errors, but didn't find quite the same.
I use the actual OpenJDK and imported the actual MySQL J connector.

If I try to import any java.sql.* package, it gets a red underline and won't do it.

What could be the cause?

答案1

得分: 11

已删除 module-info.java。现在它可以正常工作。

英文:

Deleted module-info.java. Now it works.

答案2

得分: 0

一个更好的解决方案只是在 module-info.java 中添加 requires java.sql;。这样任何其他构建依赖项也会被包括进来。

英文:

A better solution is just to add requires java.sql; to module-info.java. That way any other build dependencies are included as well.

huangapple
  • 本文由 发表于 2020年10月7日 20:42:06
  • 转载请务必保留本文链接:https://go.coder-hub.com/64244261.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定