-1

I am Currently using JDK 16 on my mac book pro so i wanted to run a fluuter project which i bought from Codecanyon and i noticed an error which i looked up and the solution was the JDK version that i need to install jdk 8 in-other to run the project, so i downloaded the JDK8 and installed but when i run

Java -version

i still get

java version "16.0.2" 2021-07-20 Java(TM) SE Runtime Environment (build 16.0.2+7-67) Java HotSpot(TM) 64-Bit Server VM (build 16.0.2+7-67, mixed mode, sharing)

i have tried adding the file path to bash file by running

touch ~/.bash_profile; open ~/.bash_profile

and adding it to my path file like bellow

export PATH="$PATH:/Users/bright/Development/flutter/bin" export PATH="$PATH:/Library/Java/JavaVirtualMachines

still when i run the

Java -version i still see the version 16...

how do i set my Mac os to be seeing the JDK 8 or better still how to set it as the default JDK?

Britchi3
  • 180
  • 5
  • 17

1 Answers1

1

there are a few questions on stackoverflow like this.

In general to set java 1.8 as the shell enviroment try this:

export JAVA_HOME=`/usr/libexec/java_home -v 1.8`

How to set or change the default Java (JDK) version on macOS?

set mac jdk version to 1.8

DEFL
  • 907
  • 7
  • 20