Skip to content

Commit ec6d2bb

Browse files
committed
Document how to customize the default Java version for lsif-java
Fixes #380
1 parent a86db1e commit ec6d2bb

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

docs/getting-started.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,29 @@ $ src lsif upload # (optional) upload index to Sourcegraph
2828
If everything went OK, a `dump.lsif` file should exist after the command has
2929
finished indexing the project.
3030

31-
> The Docker container re-downloads all dependencies on every run, which can be
32-
> slow for large projects. Consider using the [Java launcher](#java-launcher)
33-
> instead to re-use the existing build cache of your project.
31+
> The Docker container is made available for convenience at the cost of
32+
> performance. Consider using the [Java launcher](#java-launcher) instead of the
33+
> Docker container for better performance. The Docker container is a large
34+
> download because it includes multiple pre-installed Java versions (Java 8,
35+
> Java 11 and Java 17). Also, external dependencies of your codebase get
36+
> re-downloaded on every `lsif-java index` invocation.
37+
38+
Java 8 is the Java version in the Docker container. Use the following commands
39+
to change the default version:
40+
41+
- Java 11: `eval "$(coursier java --jvm 11 --env)"`
42+
- Java 17:
43+
`eval "$(coursier java --jvm temurin:17 --jvm-index https://github.com/coursier/jvm-index/blob/master/index.json --env)"`
44+
45+
Alternatively, create a `lsif-java.json` file at the root of your repository
46+
with the following values:
47+
48+
```jsonc
49+
// lsif-java.json
50+
{
51+
"jvm": "11" // or "17"
52+
}
53+
```
3454

3555
### Java launcher
3656

0 commit comments

Comments
 (0)