How to set up Java Commands to start with the Intellij ?
Hi,
So, I'm trying to run a command every time that I open IntelliJ, or (better solution) set the commands as a default on my java project. I have a project that need's to run Java 8, java 11 and Java 7, so I did the follow script that I run every time in the terminal:
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home
export JAVA_HOME=/Library/Java/JavaVirtualMachines/amazon-corretto-8.jdk/Contents/Home
alias mvn7="JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home && mvn"
alias mvn8="JAVA_HOME=/Library/Java/JavaVirtualMachines/amazon-corretto-8.jdk/Contents/Home && mvn"
export JAVA_HOME=/Library/Java/JavaVirtualMachines/amazon-corretto-11.jdk/Contents/Home
But this is such a pain, I need to keep running this every time that I want to use different versions of Java and Maven. There is anyway to set this automatically or default ?
I'm on a MAC Big Sur v. 11.4
Regards,
Fábio Carvalho
Please sign in to leave a comment.
>I need to keep running this every time that I want to use different versions of Java and Maven.
How do you use them? How exactly do you use these executables which you set up: in OS terminal or in IDE somehow or else?