Skip to content

Commit ec4f0d8

Browse files
committed
Document current issues using JDKs > 17 and nailgun
1 parent 5058691 commit ec4f0d8

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

docs/docs/jvm/java-and-scala.mdx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,27 @@ JDKs used by Pants are automatically fetched using [Coursier](https://get-coursi
6666

6767
To override the default on a particular target, you can use the [`jdk=` field](../../reference/targets/java_source.mdx#jdk). It can be useful to use the [`parametrize` builtin](../using-pants/key-concepts/targets-and-build-files.mdx#parametrizing-targets) with the `jdk=` field, particularly to run test targets under multiple JDKs.
6868

69+
To get a list of available JDK versions:
70+
71+
```sh
72+
$ coursier java --available
73+
adoptium:1.11.0.15
74+
adoptium:1.11.0.16
75+
...
76+
```
77+
78+
Please note that JDKs later than 17 are not supported by nailgun
79+
(see [#20603](https://github.com/pantsbuild/pants/issues/20603)), which
80+
must be disabled manually:
81+
82+
```toml title="pants.toml"
83+
[GLOBAL]
84+
process_execution_local_enable_nailgun = false
85+
86+
[jvm]
87+
jdk = "temurin:1.22"
88+
```
89+
6990
#### Scala version
7091

7192
The Scala version to use is configured on a resolve-by-resolve basis (see the "Third-party dependencies" section below) using the [`[scala].version_for_resolve` option](../../reference/subsystems/scala.mdx#version_for_resolve). The default Scala version for your repository will thus be whichever Scala version is configured for the "default" resolve, which is configured by the [`[jvm].default_resolve` option](../../reference/subsystems/jvm#default_resolve).

src/python/pants/option/global_options.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1453,7 +1453,12 @@ class BootstrapOptions:
14531453
)
14541454
process_execution_local_enable_nailgun = BoolOption(
14551455
default=DEFAULT_EXECUTION_OPTIONS.process_execution_local_enable_nailgun,
1456-
help="Whether or not to use nailgun to run JVM requests that are marked as supporting nailgun.",
1456+
help=softwrap(
1457+
"""
1458+
Whether or not to use nailgun to run JVM requests that are marked as supporting nailgun.
1459+
Note that nailgun only works correctly on JDK <= 17 and must be disabled manually for
1460+
later versions.
1461+
"""),
14571462
advanced=True,
14581463
)
14591464
process_execution_graceful_shutdown_timeout = IntOption(

0 commit comments

Comments
 (0)