You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/dev-notes/TROUBLESHOOTING.md
+15-16Lines changed: 15 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,38 +22,37 @@ Navigate to:
22
22
23
23
For step-by-step instructions, [refer to this answer](https://stackoverflow.com/a/79049864/1771663).
24
24
25
-
**2. List installed JDKs**
25
+
**2. Configure CLI to use JDK 17**
26
26
27
-
To identify installed JDK versions:
28
-
```bash
29
-
/usr/libexec/java_home -V
30
-
```
27
+
To avoid Gradle failures in CLI, ensure that **JDK 17** is used consistently during local development. This can be done by updating `JAVA_HOME` environment variable, either temporarily (for current session only) or permanently (via shell profile).
31
28
32
-
**3. Configure CLI to use JDK 17**
29
+
**Option 1: Use a specific JDK path or dynamic lookup**
33
30
34
-
Update shell profile (`~/.zshrc`, `~/.bash_profile`, etc.) to ensure the CLI uses JDK 17 for all Gradle tasks.
31
+
Choose either of the following, depending on preference:
32
+
33
+
- Set a known JDK 17 path (use `/usr/libexec/java_home -V` to list installed versions):
35
34
36
-
-**Option 1:** Set the path explicitly
37
-
(Use this if a specific JDK 17 path is known or was listed in Step 2. The example path below may differ.)
-**Option 2:** Use latest installed JDK 17 dynamically
40
+
- Or use dynamic lookup to always pick latest installed JDK 17:
41
+
44
42
```bash
45
43
export JAVA_HOME=$(/usr/libexec/java_home -v 17)
46
44
export PATH="$JAVA_HOME/bin:$PATH"
47
45
```
48
46
49
-
**4. Apply the environment change**
47
+
These commands can be:
48
+
-**Temporary:** Run directly in the terminal for one session
49
+
-**Permanent:** Add to shell profile like `~/.zshrc` or `~/.bash_profile`_- Restart the terminal or run `source ~/.zshrc` (or appropriate file) to apply the changes_
50
50
51
-
Run following command or restart the terminal:
52
-
```bash
53
-
source~/.zshrc # or source ~/.bash_profile
54
-
```
51
+
**Option 2: Use a Java version manager**
52
+
53
+
Tools like [jenv](https://github.com/jenv/jenv) can simplify managing multiple JDK versions across projects. This document doesn't cover setup details, but can be worth considering for long-term convenience.
0 commit comments