4

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?

Carath
  • 245
  • 4
  • 15

3 Answers3

6

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

Denis125
  • 69
  • 2
3

the problem came from this settings: enter image description here

Please uncheckUser'--release' option for cross-compilation(Java 9 and later), it's a common source of problem with the library Date

Gon
  • 183
  • 7
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)