New people asked how to configure the Java environment variable under Mac, here is a way to create an environment variable under your own account
First: Open the terminal, execute the command CD ~, this will jump to the current account, after jumping to see if there is a. bash_profile file, execute command ls-a,
If there is a direct open, with Vim or Mac comes with the open can, if not a new one, execute the command touch. Bash_profile, after creation, use the open. Bash_profile command, enter export Java_home =/ Library/java/home Export PATH = java_home/bin: $PATH, where this /library/java/home directory is Java's JDK directory, different computers may be different, You need to modify it yourself.
Summarize the process:
1.CD ~ Jump to current personal account
2. Executive Ls-a
3. See if there is a. Bash_profile, there is execution 5, no execution 4
4.touch. bash_profile New. bash_profile File
5.open. Bash_profile Open File
6. Configure Java_home export java_home =/library/java/home
7. Last added to path in export PATH = Java_home/bin: $PATH
mac-Configuring environment variables under your own account