MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

Jenkins Error: Running two Java Versions – Jenkins Problem in Mac OS

Hi Everyone – Today we are going to discuss about how to have two version of Java Development Kit running in MAC OS and how to switch between them.

This problem statement came when I was playing around with Jenkins setup – As we all Jenkins still demands Java 1.8 ! and not higher . Problem started as I had Java 1.13 as globally installed. Which in turn is not supported by Jenkins Latest version as of Feb 2020.

So when I did something like java -v on cmd , got below response:

Java -version output on macOS showing Java 13.0.1 installed

Then as all I thought no worries let me install the Java 1.8 and day will be saved, so for that I ran this :

brew cask install adoptopenjdk/openjdk/adoptopenjdk8

I’m installing Java via brew – which I personally believe is easiest way to install Java on mac – brew is a package manager for Mac OS like Chocolatey for Windows.

Which resulted in something like this :

Terminal output of brew cask install adoptopenjdk8 ending with successfully installed

Now after this step if you will try – doing java -v still you will not be able to get java 1.8 as default environment.

So What else we have to do ? Let’s explore that !

First we will list – all the java version installed on machine by :

/usr/libexec/java_home -V
/usr/libexec/java_home -V listing two JVMs, Java SE 13.0.1 and AdoptOpenJDK 8

We can see I have two versions now.

Lets make 1.8 as default version by running :

export JAVA_HOME=`/usr/libexec/java_home -v 1.8`Code language: JavaScript (javascript)

In above command I’m pointing JAVA_HOME to 1.8 version explicitly.

Lets run java -version again !

Java -version output now showing OpenJDK 1.8.0_242 from AdoptOpenJDK

Caution – Java 1.8 does not support short hand for version i.e -v instead you have to type : java -version full command to get the output.

Gaurav Bajpai

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
MotoShare.in offers unparalleled convenience and affordability in bike rentals, allowing users to enjoy hassle-free rides for commuting, exploring, or leisure trips. With a wide range of bikes and scooters, it’s your trusted partner for all two-wheeler needs.

Related Posts

Complete Tutorial: Use Two GitHub Accounts on One Mac with SSH

This tutorial explains how to configure two GitHub accounts on the same MacBook using separate SSH keys, without repeatedly switching accounts or breaking your existing Git configuration….

Read More

Development Workflows with an FTP and SFTP Client for Mac: From Local Files to Staging

An FTP and SFTP client for Mac is best suited when it displays the project that you are working on in one window and the remote server…

Read More

Essential Mac Keyboard Shortcuts: Screenshot, Show Desktop, and Quick Power Actions

A clean, practical reference for three high-value Mac shortcuts from the original post. Learn what each one does, when to use it, and where users commonly get tripped up.

Read More

The Apple Ecosystem Setup Checklist: 7 Things Most People Miss

Buying an iPhone is straightforward. Setting up a Mac is usually manageable. Pairing an Apple Watch takes only a few steps. But getting all these devices to…

Read More

Is It the Update or Your Dev Tools? Tracking Down Battery Drain After Golden Gate

Did your MacBook use to make it through a full working day, but started behaving differently after the Golden Gate update? You may have noticed the battery…

Read More

Master Guide to Managing Multiple SSH, RDP & VNC Sessions on macOS

Best MobaXterm and mRemoteNG Alternatives for Mac Administrators, DevOps Engineers and SysAdmins Managing ten servers is easy. Managing 50, 100, 500 or even thousands of Linux servers,…

Read More