#How to manage JDK version
1 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @daring oak! Please use
/closeor theClose Postbutton above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
I always wonder how can someone end up in a situation that it is bothersome. I understand it can be annoying that the version of Java currently used by a specific mechanism isn't on-screen at all times, which sometimes leads to the version not being the one expected and that is the non-obvious cause for an error
But, once you know that the version of Java needs to be not what it currently is, changing it and be done with it, I don't understand how do you end up somewhere that's a bother
because only one can have the highest priority on JAVA_HOME and Path..?
obviously
and i don't particularly like managing those every time
why do you want to switch jvm versions ? for compiling ?
it's because different frameworks require different versions
sometimes it's 11, sometimes 17, some need 8 (kafka/hadoop)
and it's just a mess
with .NET they have it figured out and i don't need to fiddle with path every time i want to run something different
you just need the SDK installed and it uses the correct one
When running the application using the framework or for compiling a program using the framework ?
for compiling you can use the most recent version of the jvm (for example 17) and compile with the --release flag.
so mvn clean install --release 8?
no --release 8 is an argument for the javac compiler not for maven.
well
i'm gonna state the obvious and say, I use gradle and maven build tools when compiling
i don't use javac directly
yeah but it should be possible to specify compiler args for javac using maven
add <maven.compiler.release>JAVA_VERSION</maven.compiler.release> to your properties in maven. Documentation can be found here: https://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-release.html
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.