I have tried all approaches I can find online, but none of them works.
I want to set JAVA_HOME and PATH environment variables permanently, so that in IntelliJ I can issue commands like "mvn".
I have written my script into .bash_profile as shown below:
screenshot
But after I restarted my Mac and issued echo $JAVA_HOME, the output is still empty.
I also tried launchd.conf as said in this answer, but it didn't work either.
Could someone help me here? Thanks in advance!
For osx add this in your ~/.profile or if you are using zsh inside ~/.zshrc
export JAVA_HOME=/Library/Java/JavaVirtualMachines/amazon-corretto-8.jdk/Contents/Home
restart your terminal or simply apply your changes
source ~/.profile
refer this to know more about related to this question & also refer this to know more about installation process of Amazon Corretto 8.
If you are using zsh you can import .profile config inside ~/.zprofile
emulate sh
. ~/.profile
emulate zsh
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With