CleanroomMC / TemplateDevEnv

Template workspace for modding Minecraft 1.12.2
MIT License
84 stars 28 forks source link

How to select a local JVM for the runClient task? #32

Closed gamerYToff closed 1 month ago

gamerYToff commented 1 month ago

I'm trying to use a specific JDK on my PC to run the runClient task. The problem is that Gradle always selects the AZUL JDK, and even if I comment out the vendor.set(JvmVendorSpec.AZUL), the task still uses another JDK 8 from the Gradle cache. Even if I try to specify this through gradle.properties or run the task via terminal by passing the JVM location as an argument, the task keeps using the same JDK 8. It only changes when I modify vendor.set.

Rongmario commented 1 month ago

Does modifying property org.gradle.java.installations.paths to tell gradle where to look for toolchains work for you? Run gradle -q javaToolchains to check.

KorewaLidesu commented 1 month ago

Run command above to see if your JDK available within Window Registry. If not, check the path and create new key and make sure path it correctly. This also happen to me cause Gradle doesn't respect IDEA java setting.

gamerYToff commented 1 month ago

gradle -q javaToolchains

My mistake, I use JVMs with DCEVM in old projects, and these VMs are all inside folders named "dcevm." For some reason, the DCEVM 8 directory contained the Java 11 binary, so Gradle couldn't find the Java 8 that it actually needed inside that directory.