devshawn / kafka-gitops

🚀Manage Apache Kafka topics and generate ACLs through a desired state file.

Home Page:https://devshawn.github.io/kafka-gitops

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

kafka-gitopts via homebrew : look for java in JAVA_HOME ?

karawitan opened this issue · comments

Hello,

Looks like the kafka-gitops depends on openjdk;
But kafka-gitops should not point at a specific java version;
Maybe you can use JAVA_HOME, as defined by homebrew ?

brew install kafka-gitops
Running `brew update --auto-update`...

(...)

==> Downloading from https://objects.githubusercontent.com/github-production-release-asset-2e65be/236228216/52467080-7181-11eb-96e0-38a372bc20f3?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230104%2Fus-east-1%2Fs3%2Faws4_requ
######################################################################## 100.0%
==> Installing kafka-gitops from devshawn/kafka-gitops
🍺  /opt/homebrew/Cellar/kafka-gitops/0.2.14: 3 files, 13MB, built in 1 second

(...)

m1:~ kalou$ cd
m1:~ kalou$ kafka-gitops
/opt/homebrew/bin/kafka-gitops: line 8: /opt/homebrew/Cellar/openjdk/19/bin/java: No such file or directory
/opt/homebrew/bin/kafka-gitops: line 8: exec: /opt/homebrew/Cellar/openjdk/19/bin/java: cannot execute: No such file or directory

m1:~ kalou$ echo $JAVA_HOME
/opt/homebrew/Cellar/openjdk/19

m1:~ kalou$ brew list | grep jdk
openjdk
m1:~ kalou$ ls -ld /opt/homebrew/Cellar/openjdk/*/bin
drwxr-xr-x  31 kalou  staff  992 Sep 13 16:16 /opt/homebrew/Cellar/openjdk/19.0.1/bin

@karawitan As you can see in the output you've posted, your JAVA_HOME environment variable is incorrect.

m1:~ kalou$ echo $JAVA_HOME
/opt/homebrew/Cellar/openjdk/19

m1:~ kalou$ brew list | grep jdk
openjdk
m1:~ kalou$ ls -ld /opt/homebrew/Cellar/openjdk/*/bin
drwxr-xr-x  31 kalou  staff  992 Sep 13 16:16 /opt/homebrew/Cellar/openjdk/19.0.1/bin

After setting JAVA_HOME to the correct directory (/opt/homebrew/Cellar/openjdk/19.0.1), it should work.

If the JAVA_HOME environment variable does not exist, it should work as long as java is on your PATH.

https://github.com/devshawn/kafka-gitops/blob/0.2.15/stub.sh#L5-L7