How to install Java 8 on Mac

0 votes

I want to do some programming with the latest JavaFX, which requires Java 8. I'm using IntelliJ 13 CE and Mac OS X 9 Mavericks. I ran Oracle's Java 8 installer, and the files look like they ended up at

/Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk

but previous versions are at

/System/Library/Java/JavaFrameworks/jdk1.6....

Not sure why the latest installer puts this in /Library instead of /System/Library (nor what the difference is). But /usr/libexec/java_home doesn't find 1.8, so all the posts I've found on how to set your current java version don't work. I've tried adding a symbolic link to make it look like 1.8 is in the /System/Library... path, but it doesn't help. /usr/libexec/java_home -V still only lists the old Java 1.6.

Ironically, the "Java" control panel under System Preferences shows only Java 1.8!

Why doesn't Oracle's installer put it where it really goes? And how can I work around this problem?

Dec 23, 2020 in Java by Roshni
• 10,480 points
2,304 views

1 answer to this question.

0 votes

Oracle has a poor record for making it easy to install and configure Java, but using Homebrew, the latest OpenJDK (Java 14) can be installed with:

brew install --cask adoptopenjdk8

For the many use cases depending on an older version (commonly Java 8), the AdoptOpenJDK project makes it possible with an extra step.

brew tap adoptopenjdk/openjdk
brew install --cask adoptopenjdk8

Existing users of Homebrew may encounter Error: Cask adoptopenjdk8 exists in multiple taps due to prior workarounds with different instructions. This can be solved by fully specifying the location with brew cask install adoptopenjdk/openjdk/adoptopenjdk8.

Hope this helps!

Check out Java course to learn more about it.

Thanks!

answered Dec 23, 2020 by Gitika
• 65,770 points

Related Questions In Java

+1 vote
0 answers

How to install java on linux operating system?

I read good info about java but ...READ MORE

May 16, 2019 in Java by Vicky

reopened 6 days ago by Neelam 660 views
0 votes
1 answer

Is it possible to run a java program from command line on windows?How?

  Let's say your file is in C:\myprogram\ Run ...READ MORE

answered Apr 18, 2018 in Java by sophia
• 1,400 points
2,682 views
0 votes
1 answer

How to pad an integer with zeros on the left in Java?

Use java.lang.String.format() method. String.format("%05d", number ...READ MORE

answered May 31, 2018 in Java by Daisy
• 8,140 points
2,268 views
0 votes
2 answers

How to parse/format dates with LocalDateTime? (Java 8)

Converting LocalDateTime to Time Zone ISO8601 String LocalDateTime ...READ MORE

answered Dec 6, 2018 in Java by Sushmita
• 6,920 points
4,407 views
0 votes
1 answer

Where is JAVA_HOME on macOS Mojave (10.14) to Lion (10.7)?

export JAVA_HOME="$(/usr/libexec/java_home -v 1.6)" or export JAVA_HOME="$(/usr/libexec/java_home -v 1.7)" or export ...READ MORE

answered Dec 4, 2018 in Java by Daisy
• 8,140 points
2,582 views
0 votes
1 answer

Need help with Java Installation

Hi @Ashmita, to asnwer your question, lets ...READ MORE

answered Feb 28, 2019 in Java by Pratibha
• 3,690 points
1,019 views
0 votes
1 answer

Install Java on Ubuntu

Hi @Anvi, to install Java on Ubuntu, ...READ MORE

answered Mar 1, 2019 in Java by Pratibha
• 3,690 points
1,663 views
0 votes
1 answer

finalize() called on strongly reachable object in Java 8

A bit of conjecture here. It is ...READ MORE

answered Mar 5, 2019 in Java by developer_1
• 3,350 points
823 views
+1 vote
13 answers

How to send HTTP POST requests on Java?

With Apache HttpClient In the old days, this Apache ...READ MORE

answered Dec 10, 2020 in Java by Rajiv
• 8,870 points
159,397 views
0 votes
1 answer

How to install the JDK on Ubuntu Linux?

Open Terminal from Application Dash or press Ctrl+Alt+T Update repository: sudo add-apt-repository ...READ MORE

answered Dec 30, 2020 in Java by Gitika
• 65,770 points
769 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP