Skip to content

Commit 1d9e1fc

Browse files
chore: add javaLauncher property documentation (#681)
* chore(paper/dev): add javaLauncher property documentation for downgrading the active Java version in paperweight-userdev * chore: rephrase * chore: another rephrase * scorpy Co-authored-by: Matouš Kučera <mk@kcra.me> * feat: apply jmp's suggestions --------- Co-authored-by: Matouš Kučera <mk@kcra.me>
1 parent dbcca4a commit 1d9e1fc

File tree

1 file changed

+24
-0
lines changed
  • src/content/docs/paper/dev/getting-started

1 file changed

+24
-0
lines changed

src/content/docs/paper/dev/getting-started/userdev.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,30 @@ You should remove any dependency on the Paper API, as the dev bundle includes th
8686

8787
:::
8888

89+
:::note[Configuring the Java toolchain for userdev setup]
90+
91+
A given dev bundle may not always support the Java toolchain Gradle is configured to use
92+
(whether configured explicitly or inherited from the Gradle runtime).
93+
If you are getting an error during the execution of `paperweightUserdevSetup` (especially patch application failures),
94+
you can try setting paperweight's `javaLauncher` property to a different Java version.
95+
96+
For example, with 1.17.1:
97+
```kts title="build.gradle.kts"
98+
paperweight {
99+
javaLauncher = javaToolchains.launcherFor {
100+
// Example scenario:
101+
// Paper 1.17.1 was originally built with JDK 16 and the bundle
102+
// has not been updated to work with 21+ (but we want to compile with a 25 toolchain)
103+
languageVersion = JavaLanguageVersion.of(17)
104+
}
105+
}
106+
```
107+
108+
Among others, the [multi-project branch of the PaperMC/paperweight-test-plugin](https://github.com/PaperMC/paperweight-test-plugin/tree/multi-project)
109+
makes use of this feature.
110+
111+
:::
112+
89113
## Gradle tasks
90114

91115
### `reobfJar`

0 commit comments

Comments
 (0)