docs: add Java version configuration for Heroku deployment (KTOR-6492)#766
docs: add Java version configuration for Heroku deployment (KTOR-6492)#766HI-JIN2 wants to merge 1 commit intoktorio:mainfrom
Conversation
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+
WalkthroughA new optional step titled "Step 4: Specify Java version" is added to the Heroku deployment guide, explaining how to specify the Java runtime version for applications targeting Java 11 or higher. The step includes instructions for creating a system.properties file and references Heroku documentation. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@topics/heroku.md`:
- Line 68: Update the sentence that currently claims "By default, Heroku uses
Java 8..." to reflect current Heroku defaults: state that heroku-24 (current)
defaults to OpenJDK 25 while heroku-22 defaults to OpenJDK 8, and clarify that a
system.properties file is only required when you need a Java version different
from the stack default; modify the paragraph in topics/heroku.md that contains
the original sentence so it either targets a specific stack (heroku-24) or
replaces the default claim with "heroku-24 defaults to OpenJDK 25 (heroku-22
defaults to OpenJDK 8)" and add the clarifying sentence about system.properties.
🧹 Nitpick comments (1)
topics/heroku.md (1)
71-74: Consider adding a language identifier to the code block.While the current style is consistent with other configuration blocks in this file (lines 37-44, 58-61), adding a language identifier would improve syntax highlighting and address the markdownlint warning.
📝 Suggested improvement
-``` +```properties java.runtime.version=11{style="block"}
</details> </blockquote></details> </blockquote></details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
|
|
||
| ### 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. |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
Heroku default Java version 2025 2026 runtime
💡 Result:
On Heroku, the default Java (OpenJDK) version depends on the stack, and it’s used only if you don’t set java.runtime.version in system.properties. [1]
- heroku-24 (current stack): default is Latest LTS (currently OpenJDK 25). Heroku changed the heroku-24 default from 21 → 25 effective September 17, 2025. [1][2]
- heroku-22: default is OpenJDK 8. [1]
As of January 21, 2026, the default patch levels include OpenJDK 25.0.2 (plus updated 21/17/11/8 patch releases). [3]
To avoid surprise upgrades, pin a version by adding system.properties, e.g. java.runtime.version=21 (or 25). [1]
Sources: [1] [2] [3]
Update Java version claim to reflect current Heroku defaults.
The documentation states Heroku defaults to Java 8, but this is inaccurate as of February 2026. Heroku's default Java version depends on the stack:
- heroku-24 (current): defaults to OpenJDK 25 (changed from 21 → 25 effective September 17, 2025)
- heroku-22 (older): defaults to OpenJDK 8
Since most applications deploy to heroku-24, the documentation should either specify which stack it targets or update the default claim to reflect OpenJDK 25. Clarify that users only need system.properties if they require a specific Java version different from the stack default.
🤖 Prompt for AI Agents
In `@topics/heroku.md` at line 68, Update the sentence that currently claims "By
default, Heroku uses Java 8..." to reflect current Heroku defaults: state that
heroku-24 (current) defaults to OpenJDK 25 while heroku-22 defaults to OpenJDK
8, and clarify that a system.properties file is only required when you need a
Java version different from the stack default; modify the paragraph in
topics/heroku.md that contains the original sentence so it either targets a
specific stack (heroku-24) or replaces the default claim with "heroku-24
defaults to OpenJDK 25 (heroku-22 defaults to OpenJDK 8)" and add the clarifying
sentence about system.properties.
|
|
||
| ### 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. |
There was a problem hiding this comment.
As far I can see, by default, the app will be built on the heroku-24 stack, which uses OpenJDK 25.
| 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. | |
| By default, Heroku uses Java 25 to run your application. If your Ktor application is compiled with a different Java version, you need to specify it explicitly 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 |
There was a problem hiding this comment.
A newly generated Ktor project will use JDK 21, so I suggest using this version instead:
| java.runtime.version=11 | |
| java.runtime.version=21 |
Description
Adds documentation for specifying Java runtime version in Heroku deployments.
Fixes
KTOR-6492
Changes
Testing