I am deploying a server built with ktor to Heroku, but when I run command
heroku open
I receive Application error
Following is shown in the logs
Exception in thread "main" java.lang.UnsupportedClassVersionError:com/zaxxer/hikari/HikariConfig 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
When I run heroku run java -version
I receive this
openjdk version "1.8.0_312-heroku"
OpenJDK Runtime Environment (build 1.8.0_312-heroku-b05)
OpenJDK 64-Bit Server VM (build 25.312-b05, mixed mode)
How can I change the Java Runtime version in Intellij idea
CodePudding user response:
You need to change the Java version on Heroku where you deploy the application (by default Heroku provides Java 8, as you correctly verified).
In the project root place a file system.properties
which contains:
java.runtime.version=11
CodePudding user response:
You need to change not the java Runtime version of IDEA, but the JDK you use to build the project to a lower version. See Project SDK.