Jump to content

my MacBook Pro doesn't like java...


Recommended Posts

hi,

I have installed java 8 twice in my MacBook Pro, that I downloaded from here,
https://www.java.com/en/download/manual.jsp
(a fairly new MBP, running Ventura 13.2.1)

but when I do "javac" in the terminal it cannot find a java installation..

so I looked in Library/Java/

only to realize all it's "installed" is two empty folders:
Library/Java/JavaVirtualMachines/   (this is EMPTY)
(and another one, I don't remember the name of the it, also in Library/Java/, it's also empty.. I have since deleted Library/Java..)

now I just tried installing it again a third time, and this time it did not install anything, there's no "Java" dir in Library/

I would appreciate some help.. I have installed java before, both on windows and macs...  I don't know what could be the problem here...

thank you..

Link to comment
Share on other sites

no, I'm not using Homebrew..  why?  does java work only with Homebrew now?

would appreciate some help here, please.. this does not make any sense..  

as mentioned, I have installed java many times in the past, starting in the 1990's, on both macs and windows machines.... why should this be a problem now?

thank you...

Link to comment
Share on other sites

ok.. I give up.. I will give Homebrew a try...
(since I can't figure out issue with installing java the traditional way..)

I first asked about Homebrew here, in connection with installing PHP,
https://www.mac-forums.com/threads/what-is-homebrew.375173/

and was advised to use MAMP..
(it's great, they said, with one command it will install PHP, Apache, & MySQL for you, so I thought great, and decided to do that.. now am running two websites on it..)

but well, I need to install Tomcat also (& need to find out what the OLDEST VERSION of it they have at Homebrew, since my J2EE website is a bit old..;-) so I might as well...
actually if I install Tomact, will it automatically install java also? I haven't been into any of this for a while now, (I'm retired now, just working on my own stuff...) I don't remember if Tomcat is dependent upon a java SDK being installed, I assume it is... 

but well, main thing I wanted to post here, is that I have seen two different unix commands for installing Homebrew, in two different websites...
following is websites and right underneath it the command I found therein to install Homebrew.. they are not the same..
(ruby? I assume the prompt is the "$", and everything else is the command, yes?)

https://devqa.io/brew-install-java/
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

https://opensource.com/article/20/6/homebrew-mac
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

would appreciate help/suggestions.. thank you..

Edited by maya8989
Link to comment
Share on other sites

ok.. disregard.. I assume it's the second command..  

however, what is the difference between these two?
(both from HB website)

$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

thank you...

 

Edited by maya8989
Link to comment
Share on other sites

great.. thank you...  oh brother..  ok... now trying to figure out what a formula is (not a command to install something?)

how do I find out what is THE OLDEST VERSION of Tomcat they have?

and can I choose what version of java to install?

I found this handy cheat sheet..  but is there a more comprehensive list of commands/formulas?
https://devhints.io/homebrew
(still don't understand formulas..)

thank you..

Link to comment
Share on other sites

Homebrew invented their own terminology for things that everyone else had communally decided on. So that doesn't help. Plus, Java isn't just "Java" since Oracle took over, so there is no simple "java" to install anymore either.

Assuming you want the JDK (for development) and not just the JRE (which isn't a thing either, technically, but it's the minimum needed to run Java programs), the "formula" you want is openjdk.
https://formulae.brew.sh/formula/openjdk

Java 8, aka 1.8, is the oldest anyone cares about, by the way.

Link to comment
Share on other sites

thank you requinix...

Quote

Java isn't just "Java" since Oracle took over, so there is no simple "java" to install anymore either.

really? well, the one I was trying to install is the only one mentioned here for the Mac..  hmmm...
https://www.java.com/en/download/manual.jsp

ok, will install and go from there.. 

thank you very much for your help...

Edited by maya8989
Link to comment
Share on other sites

What you need really depends on what you are using java for.  

The first thing to do is try and run java rather than javac.  That will help you get an idea of what was already installed, if anything.

Since you are trying to run javac  -- which is the java compiler, you want some version of the java sdk (aka the jdk).  

Typically, people don't need the jdk just to run java applications, but you do, if you're actually developing java apps that you need to compile with javac.

I would suggest just installing Java v17 which is the LTS version, which you can get from this page:  https://www.oracle.com/java/technologies/downloads/#java17

When you say you have a "fairly new" mac, it matters if it's an m1/m2 or intel based.  Make sure you download the arm installer if you have an m1/m2 or the x64 version if you have a prior generation intel based mac.

With that said, if you do install homebrew, which is useful for other things, then installing the openjdk is very simple (from the terminal).

brew install openjdk@17

 

Link to comment
Share on other sites

about a week later...

ok, so I installed Homebew...  and I can't install java with Homebrew either!!!

what is going on... 

command to install:

install openjdk@8

get error:

Error: openjdk@8: An unsatisfied requirement failed this build.

did some searching.. found this..
https://github.com/iBotPeaches/Apktool/issues/2551

oh brother....   so I can't install java at all because of some flaw in Apple M1 chip?
this is a joke, right?

oh man.. I don't believe this..

would appreciate some help/suggestions..  thank you..

 

Edited by maya8989
Link to comment
Share on other sites

well, I WAS able to install by typing just "java"... 

didn't want latest version...  I have very old stuff that might not work with a newer version of java... 

oh man.. I feel a bit like a fool having posted the above.. sorry...
(and I suspect the same might happen with Tomcat.. will not be able to choose version..)

 

 

Link to comment
Share on other sites

Older versions of java that were created before the Apple Arm (M series) chips will not work with the M1 macs.  The only builds they have are for Intel based macs.

In order to get support for the newer ones you need a newer version of Java.

Your older apps should work with newer versions of Java and Tomcat.

You might also consider trying to use Docker.  Here's the official Tomcat docker image:  https://hub.docker.com/_/tomcat

If you want to try it out (assuming you installed Docker) scroll down the page to the section that says "How to use this image." and follow those instructions. 

I would 100% be using Docker to run a local tomcat for development.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.