Skip to content

Commit 12c7d99

Browse files
committed
docs: add Java 17 troubleshooting notes
Made-with: Cursor
1 parent f40c305 commit 12c7d99

1 file changed

Lines changed: 23 additions & 1 deletion

File tree

README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Run from the folder that contains the JAR:
105105
java -jar visustruct.jar
106106
```
107107

108-
On **Windows**, double-click often works if `.jar` is associated with Java.
108+
On **Windows**, double-click often works if `.jar` is associated with Java. If an **old JRE** (e.g. 8) is the default, you will get **`Error: A JNI error has occurred`** — install **[JDK 17+](https://adoptium.net/)** and ensure `java -version` reports **17** or newer (see **Troubleshooting** below).
109109

110110
All releases: [github.com/code4teaching/VisuStruct/releases](https://github.com/code4teaching/VisuStruct/releases)
111111

@@ -118,6 +118,28 @@ All releases: [github.com/code4teaching/VisuStruct/releases](https://github.com/
118118
- [JDK 17](https://adoptium.net/) or newer (to **run** the JAR; to **build**, see below)
119119
- **Building only:** network on first run so Maven can download dependencies
120120

121+
## Troubleshooting
122+
123+
### `Error: A JNI error has occurred, please check your installation and try again`
124+
125+
This almost always means the **JVM is too old** for the JAR. VisuStruct is built for **Java 17**; an older runtime (e.g. **Java 8**) cannot load the classes and may show this message before a more specific error.
126+
127+
**Fix:** Install a **JDK or JRE 17+** (e.g. [Eclipse Temurin](https://adoptium.net/)). Then check in a terminal:
128+
129+
```text
130+
java -version
131+
```
132+
133+
You should see something like `openjdk version "17"` or `"21"`. If Windows still uses an old `java.exe`, adjust **PATH** or call the full path to the new runtime, e.g.:
134+
135+
```powershell
136+
"C:\Program Files\Eclipse Adoptium\jdk-17...\bin\java.exe" -jar visustruct.jar
137+
```
138+
139+
### `UnsupportedClassVersionError`
140+
141+
Same cause: upgrade to **Java 17+** as above.
142+
121143
## Build a runnable JAR
122144

123145
Clone or download the project and open a terminal in the project root.

0 commit comments

Comments
 (0)