Java Expert....Java/Open Source Addict

Redes Sociales

twitterlinkedinrss feedemail youtube

Mostrando entradas con la etiqueta brew. Mostrar todas las entradas
Mostrando entradas con la etiqueta brew. Mostrar todas las entradas

miércoles, 13 de abril de 2022

Manejar múltiples versiones de Java


 Hola amig@s, en este post revisaremos como administrar varias versiones de Java en nuestro computador. Para lo cual utilizaremos un proyecto llamado JENV que puede ser utilizado tanto para Linux como MAC OS. En el caso de Windows pueden utilizar este proyecto.

1.- Empezaremos realizando la instalación de JENV, para lo cual utilizaremos el gestor de paquetes para Mac llamado Brew utilizando el comando brew install jenv

2.- Configurar la variable de entorno de JENV en el archivo correspondiente según el sistema operativo, en mi caso lo realice en el archivo ~/.zshrc para Mac , cerrar el terminal o consola y volver a abrir.


3.- Añadir los diferentes JDKs que se tenga instalado en el computador, en mi caso trabajo con los JDKs 8, 11 y 17 de Amazon Corretto. Para lo cual se debe ejecutar el comando jenv add <PATH_JDK>, donde <PATH_JDK> es el lugar donde se encuentra instalado cada JDK; es decir la carpeta raíz.


 4.- Una vez agregados se puede verificarlos, ejecutando el comando  jenv versions

 

5.- Finalmente para configurar con cual JDK se trabajará en el equipo, se lo puede realizar de dos maneras. La primera a nivel global y la segunda a nivel local; es decir, en una consola a nivel de sesión. Para lo cual se utiliza el comando jenv global <version_jdk> o jenv local <version_jdk> para configurarlo global o localmente respectivamente.



lunes, 16 de agosto de 2021

Problems to Install Gradle on Mac using brew


Dear friends, 

In this post, I want to share how to fix the error about Gradle installation using brew. In my case when I  try to install Gradle, I have the following errors:


In the picture above, the suggestion was executing the commands related to git. Because as of Oct 2020 Homebrew no longer creates shallow clones and updates them. However, when I try to execute them, I had the following error:

The problem described is because for some reason the Xcode tools are missing. To continue to fix the problem about Gradle installation, you must do the following:

1. First, execute the xcode-select --install command. The pictures below show the installation process.



 

2.- Once time, these tools had finished. The next step is to execute the commands:

git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" fetch --unshallow

git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow

 

3.- Later, you must start the Gradle installation, to do this you must execute the brew install gradle command.

 

4.- Finally, execute the gradle -v command, to verify the installation.



miércoles, 24 de octubre de 2018

Install OpenJDK on MAC Computer



Hello friends, in this post I'm going to show how install the OpenJDK on Mac computer using Homebrew Package Manager . This way is very simple, for this we need to do the following:

1.- First install homebrew package manager, the indications how to do this is here.
2.- Next open a console o terminal and execute the brew tap homebrew/cask-versions command to update versions.



3.- Next execute the brew cask install adoptopenjdk8 command to install the openJDK.


4.- After that we must configure the JAVA_HOME environment variable in the .bash_profile file with the value  /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/ and export it.


Don't forget re-open the terminal to update the .bash_profile file.




5.- Finally verify the java version with the java -version command.