From 1e316459ecb40e7673573341c37f837eff023809 Mon Sep 17 00:00:00 2001 From: Yu Jin Date: Fri, 13 Feb 2026 22:32:14 +0900 Subject: [PATCH] docs: add Java version configuration for Heroku deployment Fixes KTOR-6492 - Added Step 4 to explain how to specify Java runtime version - Included system.properties file example - Added reference to Heroku official documentation - Helps users avoid deployment failures with Java 11+ --- topics/heroku.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/topics/heroku.md b/topics/heroku.md index fddbdcaf2..0f269be1b 100644 --- a/topics/heroku.md +++ b/topics/heroku.md @@ -63,6 +63,18 @@ web: ./build/install/ktor-get-started-sample/bin/ktor-get-started-sample This file specifies a path to the application's executable generated by the [stage](#stage) task and allows Heroku to start the application. You might need to replace `ktor-get-started-sample` with you project name. +### Step 4: Specify Java version (optional) {id="java-version"} + +By default, Heroku uses Java 8 to run your application. If your Ktor application is compiled with Java 11 or higher, you need to explicitly specify the Java runtime version to avoid deployment failures. + +To specify the Java version, create a `system.properties` file in the project root and add the following content: +``` +java.runtime.version=11 +``` +{style="block"} + +You can replace `11` with your desired Java version (e.g., `17`, `21`). For more information, see [Specifying a Java version](https://devcenter.heroku.com/articles/java-support#specifying-a-java-version) in the Heroku documentation. + ## Deploy an application {id="deploy-app"}