File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ type: text
2+
3+ ---
4+
5+ To change the Java version you're developing for, you need to set the version in several places. This uses Java 21 as an example.
6+ ```diff
7+ // build.gradle
8+ tasks.withType(JavaCompile).configureEach {
9+ + it.options.release = 21
10+ }
11+
12+ java {
13+ + sourceCompatibility = JavaVersion.VERSION_21
14+ + targetCompatibility = JavaVersion.VERSION_21
15+ }
16+ ```
17+ ```diff
18+ // modid.mixins.json
19+ // Also in modid.client.mixins.json if you're using split sources
20+ {
21+ + "compatibilityLevel": "JAVA_21"
22+ }
23+ ```
24+ ```diff
25+ // fabric.mod.json
26+ {
27+ "depends": {
28+ + "java": ">=21"
29+ }
30+ }
31+ ```
32+ Finally, in IntelliJ:
33+ File | Project Structure | Project Settings | Project | SDK -> Set to a Java 21 JDK
34+ File | Project Structure | Project Settings | Project | Language level -> Set to SDK default (or 21)
35+ File | Settings | Build, Execution, Deployment | Build Tools | Gradle -> Set Gradle JVM to Project SDK (or a Java 21 JDK)
You can’t perform that action at this time.
0 commit comments