Set JAVA_HOME permanently in Z-shellZ-shell (zsh) is the default shell in latest macOS operating systems. And I suppose that you already have JDK (Java Development Kit) installed. If you exit the terminal and open a new one, you will the changes lost.So how to permanently set JAVA_HOME and update PATH environment variables on macOS / Linux? Read on to know how. Setting up JAVA_HOME environment variable is the very first thing, which every programmer should know how to do in order to get started with Java development, as many Java-based applications, tools and libraries depend on JAVA_HOME.In this article, I’d like to share with you guys, about how to setup JAVA_HOME environment variable on macOS / Linux operating system, with both Bash shell and Z-shell.Basically, you can use the following commands in a terminal for setting JAVA_HOME and updating PATH environment variables:Įxport JAVA_HOME=$HOME/jdk-version/Contents/HomeĮxport PATH=$JAVA_HOME/bin:$PATHHowever, these commands have effect only in the current session.
0 Comments
Leave a Reply. |