Cannot resolve symbol 'ChronoUnit'

Answered

I updated my project to use OpenJDK 21.

My maven project builds but there's one particular import that the IDE can't find, which is:

import java.time.temporal.ChronoUnit;

I have tried

(1) Invalidate caches

(2) Repair IDE

(3) Removing SDK, adding it back again in Project Settings and Platform Settings

(4) Deleting .idea folder

Any help would be appreciated!

0
2 comments

Hello,

Which version of the IDEA you are using? Does it help when using the 2023.3 version which will be released this week at https://www.jetbrains.com/idea/nextversion/ ?

1

I also ran into this issue, and updated to the latest version. That resolved this issue.

0

Please sign in to leave a comment.