0

I just ran which java command and got the output /usr/bin/java

I also executed java -version command and also got version information output. So I believe that there is an actual java executable and not just a placeholder kind of thing. I may have installed it at some point, but I cannot remember doing that. Or does it comes pre-installed with the macOS Mojave?

If it doesn't come pre-installed, how do I get rid of it?

Edit: Below is the output of ls -l /usr/bin/java

lrwxr-xr-x  1 root  wheel  74 Sep 25 01:45 /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java
  • Why do you want to get rid of it? – nohillside Jan 15 at 20:25
  • Because if it didn't come preinstalled and also if I have no use of it, then it doesn't have to be there. – Maduranga E Jan 15 at 20:33
  • Can you add the output of ls -l /usr/bin/java to your question`? – nohillside Jan 15 at 20:50
  • @nohillside, I've updated the question with the command output. – Maduranga E Jan 15 at 21:33
  • What did java -version show? – Mark Jan 15 at 22:24
4

Java does not come preinstalled.

The /usr/bin/java command does come preinstalled, though - but it is not Java. Instead it is an Apple program that lets you decide between multiple installed JDKs (if any). If you haven't got a JDK installed, which is how the system is by default, it will tell you via a popup and let you click a button to be directed to a download site for the JDK.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .