• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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

 
Ranch Hand
Posts: 327
  • 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: 15728
368
  • 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: 327
  • 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: 2442
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: 327
  • 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.
 
Whatever you say buddy! And I believe this tiny ad too:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic