What would be the best setup for intellij+git to m...
# intellij
j
What would be the best setup for intellij+git to make sure everyone opening one project will be using the same jvm version? I can see collegues using anything from jvm8 to jvm15 and they don't even know why or when they switch between these versions.
w
If the build is in Gradle, perhaps you can use the new Toolchains feature to specify the jvm jdk used for building?
j
Thanks, I will take a look at jvm toolchains 👍 I'm using kotlin gradle script.
w
https://docs.gradle.org/current/userguide/toolchains.html there’s even an instruction on how to configure Kotlin compile task with a toolchain
👍 1
I’m not sure if it’s considered experimental still, but definitely a nice feature, as Gradle will also manage downloading the required toolchains
j
yeah, this looks super intreseting 🙂 We have an issue that there is no control of what the developers are using and we try to commit our run configurations. But they often fail as one might be using jvm 13 and someone else only has jvm 15 installed, then they keep chaning our run configurations 😛 I would like some great way of solving this issue. And this seems like exactly what I was looking for.
w
Let me know how it works, we haven’t implemented it for our build but it seems like it’s worth it 🙂
j
Will do 👍
I never wrote back. But no, it did not just work. So I decided to wait with this. I will probably give it another try sometime in the future.
w
Thanks, shame. Any particular blocker that prevented using this feature?
j
it reported that the toolchain function couldn't be found, and currently I just don't have time for figuring out why or what I'm doing wrong.
👍 1
Copy code
tasks {
  java {
      toolchain {
          languageVersion.set(JavaLanguageVersion.of(11))
      }
  }
}
I tried again and seems like this worked 👍