Skip to content

Commit c6d54a3

Browse files
committed
hint about exporting JAVA_HOME with sdkman
1 parent ecd021c commit c6d54a3

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,14 @@ You will need to have:
7272
Install **Swift**, the easiest way to do this is to use **Swiftly**: [swift.org/install/](https://www.swift.org/install/).
7373
This should automatically install a recent Swift, but you can always make sure by running:
7474

75-
```
76-
> swiftly install 6.1.2 --use
75+
```bash
76+
swiftly install 6.1.2 --use
7777
```
7878

7979
Install a recent enough Java distribution. We validate this project using Corretto so you can choose to use that as well,
8080
however any recent enough Java distribution should work correctly. You can use sdkman to install Java:
8181

82-
```
82+
```bash
8383
# Install sdkman from: https://sdkman.io
8484
curl -s "https://get.sdkman.io" | bash
8585
sdk install java 17.0.15-amzn
@@ -91,6 +91,13 @@ sdk use java 21.0.7-amzn
9191

9292
Make sure to use Java 21 because Gradle 8.10 isn't quite ready for JDK 24 as time of writing this readme (if this changes, please update the readme).
9393

94+
❗️ Please make sure to `export JAVA_HOME` such that swift-java can find the necessary java libraries!
95+
When using sdkman the easiest way to export JAVA_HOME is to export the "current" used JDK's home, like this:
96+
97+
```bash
98+
export JAVA_HOME="$(sdk home java current)
99+
```
100+
94101
### Testing your changes
95102
96103
Many tests, including source generation tests, are written in Swift and you can execute them all by running the

0 commit comments

Comments
 (0)