Java runtime error - newer version.
Firstly, I'm just starting to learn Kotlin and haven't progressed much beyond the "Hello Word!" stage.
I've been using Intellij IDEA 2022.3.3 Community to compile basic Kotlin programs to a Jar file to run under Windows Powershell when I need to experiment with inputting data (Kotlin Playground is great but doesn't have a stndin).
I decided to upgrade to the latest version - 2023.1 and every program I've compiled since (either newly written or a rebuild of previously working code) generates the following Java exception when I run it:
Exception in thread "main" java.lang.UnsupportedClassVersionError: MainKt has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
I'm fairly clueless to how Java fits together but I would assume that the Java Runtime is installed as part of the overall Java installation. My Control Panel applet for Java advises that I have the most recent version installed (32 & 64 bit versions).
Going back to the previous version of intellij IDEA has everything working nicely again.
Is there a simple way to resolve this exception? If not the 2022.3.3 will do me fine.
请先登录再写评论。
Thank you, I'll have a play at some point and see if that helps (although Intellij IDEA is a bit daunting for a newbie).
At present I've gone back to the earlier version, which works, and this will be fine while I work though the beginners track on Hyperskills.
Thank you again.
Same problem for me after update to 2023.1
I checked jdk versions, reimported project etc.
Only rollback to 2022.3 helped.
I reinstalled 2023.1 again and it worked straight away. I don't know whether anything's changed in the installation file but all's good.
If I start a new project the JDK is showing as 19.0.2. and this seems to work with the JVM.