If you purchased a new Mac device (Macbook, iMac, Mac mini) and trying to run java or javac command in Terminal you will get the below error as there is no Java Runtime pre-installed.
code2care@mac ~ % java The operation couldn’t be completed. Unable to locate a Java Runtime. Please visit http://www.java.com for information on installing Java. code2care@mac ~ % javac The operation couldn’t be completed. Unable to locate a Java Runtime. Please visit http://www.java.com for information on installing Java.
You need to visit http://www.java.com and download java dmg setup and install.
Note: Native M1 Oracle Java is not yet available for MacBooks/Mac Mini's that are running on Apple Silicon M1 Chips, this setup will work using Rosetta 2 - which will convert the code for you!
Intel-based Mac running Mac OS X 10.7.3 (Lion) or later.
Update: You can install Open JDK that natively supports M1 Mac's : https://code2care.org/q/install-native-java-jdk-jre-on-apple-silicon-m1-mac
- How to load zsh profile on opening shell terminal
- Set Python 3.8 as a default python version on macOS
- Show CPU and Memory Usage on macOS Menu Bar
- How to save macOS Terminal outputs as text file
- How to install wget on macOS
- Display ls command file sizes in KB (kilobytes) MB (megabytes) or GB (gigabytes) [Linux/macOS]
- How to Change Mouse Wheel Scroll Direction on Mac
- macOS R installation steps
- How to open terminal on Mac to run commands
- How to know your Mac Screen Resolution?
- Safari - Get HTTP Request Response Headers
- Opening mac Terminal
- bash: command not found error [macOS Terminal Linux, Unix or Windows]
- Add Bookmark macOS Safari
- How to check RAM details on Mac?
- How to install Java on macOS [Big Sur]
- How to Display Analog Clock on Mac Menu Bar
- How to remove app from Dock when closed [macOS Big Sur]
- How to add to PATH in macOS Big Sur
- Keyboard Shortcut to delete a file on a Mac [Macbook]
- How to increase macOS Terminal text font size (Big Sur)
- Permanently set $PATH variable in Mac Zsh shell
- Delete a Directory using Mac Terminal Command
- Remove Now Playing icon from macOS Big Sur Menu Bar
- How to find files taking up space on your Mac
- PowerShell git: The term git is not recognized as the name of a cmdlet - Microsoft
- How to check if Java main thread is alive - Java
- List of Java versions - Java
- How to add to PATH in macOS Big Sur - MacOS
- Microsoft 365 Excel - PRO TIP Discover insights quickly with Power BI, which is already included in your Microsoft services, See it in action - Microsoft