Couldn't find type java.sql.Date. Are you missing a dependency on your classpath?

只愿长相守 提交于 2021-02-10 07:33:57

问题


I'm trying to run my application in Spring Boot using MongoDB with spring-data but I can't because IntelliJ shows me this error during build:

Error:java: Couldn't find type java.sql.Date. Are you missing a dependency on your classpath?

I'm using mongo java driver version 3.8.2, spring boot 2.1 and project is in Java 11. I have no idea what is wrong here could someone help me please?


回答1:


Settings -> Build, Execution, Deployment -> Build Tools -> Maven/Gradle -> Runner -> tic on "Delegate IDE build/run actions"




回答2:


IDEA > File > Settings > Build, Execution, Deployment > Compiler > Annotation Processors

  • click/select the module in which you're encountering the troubles (middle part of the settings window)
  • ensure "Obtain processors from project classpath" is ticked (unselect custom "Processor path" option)


来源:https://stackoverflow.com/questions/54793087/couldnt-find-type-java-sql-date-are-you-missing-a-dependency-on-your-classpath

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