How to Switch Java Versions on MacOS

Answered

I'm trying to change the Java version on my Mac M1, because when I run the application in the console, it says that the version I have as default is not the same as the one I'm running the app on. I've already tried accessing these contents here: https://www.ninniku.tw/java-version-shuffle-how-to-switch-java-versions-on-macos-with-ease/#:~:text=Open%20Terminal%20on%20your%20Mac.&text=This%20will%20open%20the%20nano,file%20in%20your%20home%20directory.&text=Replace%20the%20path%20with%20the,version%20you%20want%20to%20use.

https://medium.com/@devkosal/switching-java-jdk-versions-on-macos-80bc868e686a

https://stackoverflow.com/questions/21964709/how-to-set-or-change-the-default-java-jdk-version-on-macos

but none of them worked, does anyone know how to change them? Please!

0
1 comment

This question doesn't seem to be directly related to IntelliJ IDEA. Please post your query on SO for more useful responses: https://stackoverflow.com.

Some information on how to change the Java version in IntelliJ (might be useful for other users finding this post):
- Set up the project JDK: https://www.jetbrains.com/help/idea/sdk.html#set-up-jdk
- Set java compiler version: https://www.jetbrains.com/help/idea/java-compiler.html#compiler
- Set java version for Maven runner: https://www.jetbrains.com/help/idea/maven-support.html#maven_runner_jdk
- Set java version for Gradle: https://www.jetbrains.com/help/idea/gradle-jvm-selection.html

0

Please sign in to leave a comment.