Previously, only sourceCompatibility and targetCompatibility were used, and they might cause issues like NoSuchMethodError when a newer javac compiles with -target older_release.
Note: it is good to use a new an up to date javac to avoid issues in the compiler itself, so having a proper -release .. configuration is vital.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/apple/pkl/pull/1080
**Author:** [@vlsi](https://github.com/vlsi)
**Created:** 5/28/2025
**Status:** ✅ Merged
**Merged:** 5/28/2025
**Merged by:** [@bioball](https://github.com/bioball)
**Base:** `main` ← **Head:** `java_target`
---
### 📝 Commits (1)
- [`6e6d7f1`](https://github.com/apple/pkl/commit/6e6d7f1097d4adf9ee32d15469faa73bdbcd3cf8) Use javac -release and kotlinc -Xjdk-release
### 📊 Changes
**4 files changed** (+15 additions, -18 deletions)
<details>
<summary>View changed files</summary>
📝 `buildSrc/build.gradle.kts` (+6 -4)
📝 `buildSrc/src/main/kotlin/pklAllProjects.gradle.kts` (+4 -5)
📝 `buildSrc/src/main/kotlin/pklJavaLibrary.gradle.kts` (+1 -8)
📝 `buildSrc/src/main/kotlin/pklKotlinLibrary.gradle.kts` (+4 -1)
</details>
### 📄 Description
Previously, only sourceCompatibility and targetCompatibility were used, and they might cause issues like NoSuchMethodError when a newer javac compiles with -target older_release.
Note: it is good to use a new an up to date javac to avoid issues in the compiler itself, so having a proper `-release ..` configuration is vital.
See https://www.morling.dev/blog/bytebuffer-and-the-dreaded-nosuchmethoderror/
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/apple/pkl/pull/1080
Author: @vlsi
Created: 5/28/2025
Status: ✅ Merged
Merged: 5/28/2025
Merged by: @bioball
Base:
main← Head:java_target📝 Commits (1)
6e6d7f1Use javac -release and kotlinc -Xjdk-release📊 Changes
4 files changed (+15 additions, -18 deletions)
View changed files
📝
buildSrc/build.gradle.kts(+6 -4)📝
buildSrc/src/main/kotlin/pklAllProjects.gradle.kts(+4 -5)📝
buildSrc/src/main/kotlin/pklJavaLibrary.gradle.kts(+1 -8)📝
buildSrc/src/main/kotlin/pklKotlinLibrary.gradle.kts(+4 -1)📄 Description
Previously, only sourceCompatibility and targetCompatibility were used, and they might cause issues like NoSuchMethodError when a newer javac compiles with -target older_release.
Note: it is good to use a new an up to date javac to avoid issues in the compiler itself, so having a proper
-release ..configuration is vital.See https://www.morling.dev/blog/bytebuffer-and-the-dreaded-nosuchmethoderror/
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.