If I understand your question properly, you can set the "Language Level" in IntelliJ independent from the Project SDK
Navigate to "File - Project Structure" Settings -> SDK and Language Level
So even you have SDK 22, you can set it to behave like JDK 17. This setting is stored in .idea\misc.xml