Identifying JAVA_HOME on macOS Mojave (10.14) to Lion (10.7)
Despite being an optional package in recent macOS versions, Java's installation on these systems raises concerns about the incorrect configuration of the JAVA_HOME environment variable.
Solution:
To ensure the environment variable is set appropriately, include the following line in your ~/.bash_profile file, depending on your installed Java version:
Note for brew-installed OpenJDK:
If OpenJDK was installed via brew on macOS, run the following command to make the above solution work:
sudo ln -sfn /usr/local/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk
Additional Considerations:
The above is the detailed content of How Do I Set the JAVA_HOME Environment Variable on macOS Mojave (10.14) to Lion (10.7)?. For more information, please follow other related articles on the PHP Chinese website!