• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
  • paul wheaton
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Rob Spoor
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:

org.apache.maven.plugins:maven-compiler-plugin:3.10.1:compile cannot compile class LocalDate

 
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
LocalDate should be available in java 17, but why maven-compiler-plugin:3.10.1 cannot recognize it?
the project is mainly from https://spring.io/guides/gs/accessing-data-mysql/
I just change the user class to add one more property with datatype LocalDate


in my pom.xml, java is using version 17

but the error seems it is not using java 17 to compile.


the error message is


the pom is


the failed compile class is


I try to import java.time package but still fail.

 
Saloon Keeper
Posts: 15253
349
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you write:
Then that's the problem.

It should be

Or use single class imports if that's your cup of tea.
 
peter tong
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:Did you write:
Then that's the problem.

It should be

Or use single class imports if that's your cup of tea.



yes, after I change to

the class can be compiled.
But why Intellij cannot show me the error before?
I already check the checkbox build project automatically in Build, Execution, Deployment > Compiler.
IntelliJ should compile the class automatically when I save the class.
 
Bartender
Posts: 2402
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sometimes,  you may need to do File -> Invalidate Cache and restart your IntelliJ in order to make IntelliJ to work properly.
 
peter tong
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

peter tong wrote:
But why Intellij cannot show me the error before?
I already check the checkbox build project automatically in Build, Execution, Deployment > Compiler.
IntelliJ should compile the class automatically when I save the class.



Success finally, I  think the critical step is Right-click on pom.xml and then click on "Add as Maven Project" after new project from intellij  File > new > project from version control.
 
I just had the craziest dream. This tiny ad was in it.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic