![multiple jdk on mac multiple jdk on mac](https://res.cloudinary.com/practicaldev/image/fetch/s--9wOvG_-p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sj37pahlktcupytqpdrg.png)
I still got the output stating Version is Java 14 which meant that even though I had installed Java JDK 8, the machine default was still set to Java JDK 14. After installing Java JDK 8 I tried to run the command. Hence, I went ahead and reinstalled Java JDK 8 by downloading it from Oracle's official website. When I ran into this issue, I had installed Java JDK 14 to run (Project B) and that compiled without any errors, however, when I tried to run (Project A) it would throw a Java error, I understood that the issue came from the Java JDK version upgrade.
![multiple jdk on mac multiple jdk on mac](https://miro.medium.com/max/1400/1*crChZmcVwjO3wuJWhychLw.png)
It is important to note that I am not running the React-Native project using Android Studio, instead I am using the following command: react -native run -android Another project (Project B) which was developed in Java requires me to use Java JDK 14 or above, this is where the issue occurs. It cannot compile on any Java JDK that is higher than Java JDK 8 because of the Gradle version installed in the application when it was created. One of my client's projects (Project A) is developed using Facebook's React-Native and it requires Java JDK 8 to compile for the Android version.
#MULTIPLE JDK ON MAC MAC OS#
The setup I will explain runs perfectly fine on my machine which is a MacBook Pro with Mac OS Monterey Version 12.2. However, in the case of Node, I use Node Version Manager (NVM) to manage multiple versions. Similarly, different versions of Node are required for running different projects. I am a full-time Software Developer which means I run multiple projects on my machine and each project may require a different version of Java JDK to compile or build.