How to Install Java JDK on Mac and set JAVA_HOME

Publicado el: 30 julio 2022
en el canal de: MobileTesting
8,601
37

In this videos we'll see how to install Java JDK on Mac and set JAVA_HOME in the path using the ~/.zshrc file

Error:
The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http://www.java.com for information on installing Java.

Command to install Java in Mac:

brew search java
brew info java
brew install java
ls /usr/local/Cellar/openjdk
ls /usr/local/opt/openjdk
sudo ln -sfn /usr/local/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk
java -version

Commands to install openjdk java version 8
brew search openjdk
brew install openjdk@8
sudo ln -sfn /usr/local/opt/openjdk@8/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-8.jdk


Set the JAVA_HOME in ~/.zshrc file
vim ~/.zshrc
export JAVA_HOME=/Library/Java/JavaVirtualMachines/openjdk-8.jdk/Contents/Home/
source ~/.zshrc
java -version

To see all versions of Java installed in the Machine:
ls -lsa /Library/Java/JavaVirtualMachines

#java #javajdk #jdk #installjava #javainstall #mac


En esta página del sitio puede ver el video en línea How to Install Java JDK on Mac and set JAVA_HOME de Duración hora minuto segunda en buena calidad , que subió el usuario MobileTesting 30 julio 2022, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 8,601 veces y le gustó 37 a los espectadores. Disfruta viendo!