JavaRequirement Unsatisfied installing Maven - java

I'm having some trouble installing maven on my machine via homebrew. THis is what I get when trying to install maven:
❯ brew install maven
[16:27:20]
maven: Java 1.7+ is required to install this formula.
JavaRequirement unsatisfied!
You can install with Homebrew-Cask:
brew cask install java
You can download from:
https://www.oracle.com/technetwork/java/javase/downloads/index.html
Error: An unsatisfied requirement failed this build.
I have already installed java via homebrew on this machine. Here's an output of my homebrew config:
❯ brew config [16:30:37]
HOMEBREW_VERSION: 1.3.5-28-gc4e8c79
ORIGIN: https://github.com/Homebrew/brew
HEAD: c4e8c7906d12399b34188cd3395b8f9d30dc89b3
Last commit: 75 minutes ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: ebaf0a5b91c45b9ff3b99dfc5b7955a420cafb5f
Core tap last commit: 8 minutes ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/Homebrew
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: octa-core 64-bit skylake
Homebrew Ruby: 2.3.3 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/bin/ruby
Clang: 9.0 build 900
Git: 2.14.2 => /usr/local/bin/git
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
Java: 9.0.1
macOS: 10.12.6-x86_64
Xcode: N/A
CLT: 9.0.1.0.1.1506734476
X11: N/A
And I've confirmed that java does indeed work (i.e. compiled / run a file).
Any thoughts on what I can do? I looked around google, but none of the other links I found seemed to have what I needed.
Thank you!
-parth
EDIT: I actually found a fix for my issue here https://github.com/Homebrew/homebrew-core/issues/19459, the gist of which is to do:
brew cask install caskroom/versions/java8
instead of just
brew cask install java
But, i'm going to leave this open since I'm not really quite sure why it worked.

Related

Homebrew : Error: openjdk#8: no bottle available

I am trying to install Java 8 with OpenJDK in an M1 Macbook terminal and it gives the following error. Command that I used was brew install openjdk#8
Error: openjdk#8: no bottle available!
You can try to install from source with:
brew install --build-from-source openjdk#8
Please note building from source is unsupported. You will encounter build
failures with some formulae. If you experience any issues please create pull
requests instead of asking for help on Homebrew's GitHub, Twitter or any other
official channels.
At the moment, there is no version of openjdk#8 that supports M1 x64 bit chips in Macbooks. But, there is an alternative and it could be installed using this website : https://adoptium.net/temurin/releases/?version=8

openjdk#8: no bottle available

When I tried to install Hive through homebrew it throws below error:
homebrew install hive
Error: openjdk#8: no bottle available!
Has anyone solved this issue?
I did a bit of research in google and someone said "this is because the M1 chip needs it's own special version of OpenJDK ".
Apple silicone M1 and similar processors have the ARMv8.4 architecture and rosetta2 to launch native amd64 binaries on the arm64 processor. So apple silicone may launch nearly any app compiled for the Intel platform (there is some exception, for example, the older version of PostgreSQL won't be launched by rosetta2).
By default, homebrew detects the platform that is installed and tries to find the bottle that is appropriate for arm64. In some cases, there is no bottle for some applications (for example, you can't install openjdk#8 on arm64 because there is no bottle). But you can install, for example, oracle JDK because there is the bottle for arm64 (but it will install amd64 binaries). It is a pretty confusing situation, isn't it?
The decision is to install the second copy of homebrew into the /usr/local/homebrew directory and launch it in compatibility mode with the command arch -x86_64. You won't start the original homebrew with this command because it will lid to mix arm64 and amd64 binaries (and what you will do, if you need the same library for both platforms? libpq as an example).
So there is the step-by-step guide:
Download homebrew curl -L https://github.com/Homebrew/brew/tarball/master --output homebrew.tar
Extract tarball to /usr/local/homebrew
chown -R to allow start apps from this folder
Add aliases to your ~/.zshrc file
# If you come from bash you might have to change your $PATH.
# need this for x86_64 brew
export PATH=$HOME/bin:/usr/local/bin:$PATH
# for intel x86_64 brew
alias axbrew='arch -x86_64 /usr/local/homebrew/bin/brew'
Now start new console and launch installation, for example axbrew install openjdk#8
Install other Intel binaries you need the same way. Remember that it will be installed into the /usr/local/homebrew/ directory - fill free to create a symlink if you wanna use it something else.
The slight disadvantage - the java_version tool won't see the OpenJDK in /user/local directory, but symlink to /Library/Java/JavaVirtualMachines/ will solve this problem.
Finally, I found a solution. First, We need to install Homebrew with Rosetta under /usr/local and then we can try installing everything the same way.
Combine Gleb Yan's answer and another website's solution https://github.com/Homebrew/discussions/discussions/2723. What I do is
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Then run
arch -x86_64 /usr/local/homebrew/bin/brew install openjdk#8
Then
arch -x86_64 /usr/local/homebrew/bin/brew install hive
Reminder two separate Homebrew hierarchies on your machine, an Intel-only one under /usr/local, and an M1-only one under /opt/homebrew

Pygame and Java JDK 13 installation troubles

Good morning guys,
trying to install the Pygame library on my MacBook Pro...
I encountered some issues that I'm sure you're able to help me with!
First of all I installed the last Python version (3.7.4)
Than I tried to install via pip the Pygame library, but the process
was unsuccessful due to the lack of a Java JKD 13.
I downloaded and installed the last JDK 13 version (Jdk-13_osx-x64)
and this process appeared to be successful.
Trying again to finally install the Pygame library an error occurred:
Unable to locate an executable at "/Library/Java/JavaVirtualMachines/jdk-13.jdk/Contents/Home/bin/apt
Can anyone of you guys help me???
Thanks prior!
For Python and Java developers using macOS, I personally recommend installing Python and Java through HomeBrew.
Before you can start your journey as a software developer, you should install Xcode and xcode-select first which is mandatory.
You can install Xcode from Mac AppStore and xcode-select through the following command:
xcode-select --install
After installing the prerequisites, you can install HomeBrew via:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Which is referenced from here
After you've installed HomeBrew you can install Python3 and AdoptopenJDK via the following command:
brew install python3
brew cask install adoptopenjdk
AdoptopenJDK is an open source JDK recommended by myself other than Oracle JDK.
Apt used to be a command coming with the Java Development Kit around Java 6.
Java 6 is also the latest 32-bit version provided by Apple but that doesn’t run on the newest version of Mac OS.
I think you should look for a newer version of pygame compatible with your system.

problem about installing bazel with homebrew

When I installed bazel with homebrew, I got the following error.
Updating Homebrew... bazel: Java 1.8 is required to install this
formula. JavaRequirement unsatisfied! You can install with Homebrew
Cask: brew cask install homebrew/cask-versions/java8 You can download
from:
https://www.oracle.com/technetwork/java/javase/downloads/index.html
Error: An unsatisfied requirement failed this build.
I installed (newest version) Java with homebrew.
I do not want to install two versions of Java in my mac.
How do I install bazel based on the available Java?
I do not want to install two javas in my mac.
You have to, or remove the version you currently have. Bazel needs java 8 and no other versions are supported as mentioned in the docs:
You must install version 8 of the JDK. Versions other than 8 are not supported.
JDK is not mandatory. Please check bazel github release page: https://github.com/bazelbuild/bazel/releases

Install cuda java on mac 10.9

I am trying to install the GNU scientific library using homebrew on OSX (version 10.9.5) following this link:
$ brew install caskroom/cask/brew-cask
$ brew cask install cuda java
$ brew install clang-omp swig bazel cmake libusb maven nasm yasm xz pkg-config
When I type brew cask install cuda java I get the following error message:
Error: Cask 'cuda' definition is invalid: Bad header line: parse failed
What does this mean, and how do I resolve this? If there is another way to get GSL on Java that would also be helpful.
That formula doesn't seem to exist.
You can look on https://github.com/caskroom/homebrew-cask/tree/master/Casks yourself to see a list of formula offered. There is a cuda and cuda-z formula shown, but no cuda java.
If you want to make absolutely sure you are not missing something, try:
brew search cuda java

Categories