Replacing the JDK
Answered
If I create a new Kotlin project with the Oracle JDK and later decide to switch to an OpenJDK by another vendor (for example AdoptOpenJDK), can I simply replace it? Or do I have to create a new project?
My other question: What about all this Windows environment variable stuff? Do I have to bother with that if I just want to use the JDK to develop Kotlin/Java projects?
Please sign in to leave a comment.
You don't need any environment variables configured if you are working in IntelliJ IDEA.
Replacing a JDK is a matter of adding a new JSDK configuration in the Project Structure | SDKs, then change your project JDK to the new one.
Thank you. So you can switch from let's say the paid Oracle JDK to AdoptOpenJDK with a few easy configurations? There are no compatibility problems?
We can't tell for all the JDKs, it depends on the vendor, version, etc.
Configuration is easy, whether or not you will have issues depends on the JDK you are going to use.
Thank you. Do you by any chance know why so many Java tutorials talk about changing these environment variables and what is the difference that makes it unnecessary in IntelliJ?
Environment variables are needed when you build from the command line. When you build in the IDE, you already have the paths to Gradle/JDK etc specified in the IDE.
Thank you very much for clarifying that!