Skip to content

docs: add Java version configuration for Heroku deployment (KTOR-6492)#766

Open
HI-JIN2 wants to merge 1 commit intoktorio:mainfrom
HI-JIN2:fix/ktor-6492-heroku-java-version
Open

docs: add Java version configuration for Heroku deployment (KTOR-6492)#766
HI-JIN2 wants to merge 1 commit intoktorio:mainfrom
HI-JIN2:fix/ktor-6492-heroku-java-version

Conversation

@HI-JIN2
Copy link
Contributor

@HI-JIN2 HI-JIN2 commented Feb 13, 2026

Description

Adds documentation for specifying Java runtime version in Heroku deployments.

Fixes

KTOR-6492

Changes

  • Added Step 4 in the "Prepare an application" section
  • Explains Heroku's default Java 8 behavior
  • Provides instructions for Java 11+ users
  • Includes system.properties file example
  • Links to official Heroku documentation

Testing

  • Verified markdown syntax
  • Checked link validity
  • Ensured consistency with existing documentation style

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+
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 13, 2026

Walkthrough

A 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

Cohort / File(s) Summary
Heroku Documentation
topics/heroku.md
Added optional "Step 4: Specify Java version" section explaining Heroku's Java default behavior and providing instructions for configuring Java runtime versions.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested reviewers

  • e5l
  • osipxd
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title clearly and specifically summarizes the main change: adding documentation for Java version configuration in Heroku deployments, with an issue reference.
Description check ✅ Passed The description is directly related to the changeset, providing clear context about documentation additions for Java version configuration in Heroku deployments and testing performed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 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.

Copy link
Collaborator

@vnikolova vnikolova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @HI-JIN2, thanks for picking this one up 🙏
It looks like the YT issue is a little outdated and the default OpenJDK versions are now different (See comments below)


### 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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far I can see, by default, the app will be built on the heroku-24 stack, which uses OpenJDK 25.

Suggested change
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A newly generated Ktor project will use JDK 21, so I suggest using this version instead:

Suggested change
java.runtime.version=11
java.runtime.version=21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants