downloaded installed Java18 -- but not showing up in java -version in Terminal

Joined
Feb 3, 2008
Messages
315
Reaction score
5
Points
18
Hope this is the right place. Just downloaded and installed Java18, but when i enter java -version in the Terminal app it says I still have Java 1.8 (or Maybe Java 8). Can someone out there tell me what's wrong and what I can do to fix this?
 
Joined
Oct 16, 2010
Messages
18,158
Reaction score
1,905
Points
113
Location
Brentwood Bay, BC, Canada
Your Mac's Specs
2020 27" i9 5K nano iMac, 1TB(partitioned) SSD, GB, macOS 15.3.1 Sequoia
Just downloaded and installed Java18, but when i enter java -version in the Terminal app it says I still have Java 1.8 (or Maybe Java 8). Can someone out there tell me what's wrong and what I can do to fix this?

If I may ask, for what and why would one want or need to download Java on a Mac in this day and age??

I don't mean to be rude and I am just rather curious as I thought it had died along with any support several years ago, yet I see there is a version of it available for Mac use:


Or is it still used as some sort of developer thing???

Thanks for any Mac OS enlightenment.


- Patrick
=======
 
Joined
Oct 16, 2010
Messages
18,158
Reaction score
1,905
Points
113
Location
Brentwood Bay, BC, Canada
Your Mac's Specs
2020 27" i9 5K nano iMac, 1TB(partitioned) SSD, GB, macOS 15.3.1 Sequoia
I download it from the oracle website. I'm learning java.


Thanks, and good luck with your learning and Java programming.

I was a bit surprised to read all these hits considering how Java has been treated on the Mac platform when I used Google to ask the question:


- Patrick
=======
 

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
16,034
Reaction score
2,441
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
Install Homebrew instead and install openjdk as opposed to the licensed Oracle Java. It'll come to the same thing and easier to manage.

The other option is to use an IDE like IntelliJ IDEA and then have it download the Java SDK on its own for use in your projects.
 
OP
S
Joined
Feb 3, 2008
Messages
315
Reaction score
5
Points
18
But in the past i've been able to download and install the Oracle java and it automatically updates to the latest version.
 

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
16,034
Reaction score
2,441
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
I'm not saying that the Oracle version won't work. Back in the day, you could also just as easily do "java -version" on the Terminal prompt and if Java wasn't installed, macOS would show you a pop-up allowing you to download it. That doesn't happen anymore.

If your goal is to learn Java, can use it from a local folder without having it installed globally and since you'll need an IDE to code anyway, why not combine all that together.
 
OP
S
Joined
Feb 3, 2008
Messages
315
Reaction score
5
Points
18
So are there any commands you know of that will let me set out as the default? It’s on the Java folder, but I’m not sure how to set it as the default
 
Joined
Aug 4, 2007
Messages
303
Reaction score
8
Points
18
Location
Yorkshire, England
Your Mac's Specs
MacOS Sonoma
The current version of Java is 8.0.333. I would ignore the 1.8.0_333 as it refers to exactly the same version of Java. To develop java applications you really need to use the JDK version (Java Development Kit) which comes with the Runtime and the Compiler tools. You can download the non-commercial version of JDK from OpenJDK JDK 18.0.2 GA Release and it should be installed/copied to /Library/Java/JavaVirtualMachines where macOS will auto look there for you. You can set the which version of Java to use by setting JAVA_HOME variable:
 
OP
S
Joined
Feb 3, 2008
Messages
315
Reaction score
5
Points
18
The problem has been solved. I updated to high Sierra, and when I entered Java – version job at 18.0.2 came up.

So obviously there was something in El Capitán that prevented it from seeing the Most current Java version I had installed and downloaded, so does anyone have any ideas why that was? I’m just curious and would like to know if anybody has any answers or ideas.
 
Joined
Oct 16, 2010
Messages
18,158
Reaction score
1,905
Points
113
Location
Brentwood Bay, BC, Canada
Your Mac's Specs
2020 27" i9 5K nano iMac, 1TB(partitioned) SSD, GB, macOS 15.3.1 Sequoia
I’m just curious and would like to know if anybody has any answers or ideas.


Maybe someone at the Apple Developer forums or similar might know..???


- Patrick
=======
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top