confluentinc / confluent-cli

Confluent Platform CLI
Other
60 stars 38 forks source link

Invoking "confluent local services start" fails (requires Java version 1.8 or 1.11) with OpenJDK 14.0.2 #134

Closed amotl closed 4 years ago

amotl commented 4 years ago

Hi again,

as mentioned in #133, we just found a problem with the new Confluent CLI. While these commands would work flawlessly:

confluent local services kafka start
confluent local services zookeeper start

these commands will croak:

confluent local services connect start
confluent local services kafka-rest start
confluent local services ksql-server start
confluent local services schema-registry start

The error is:

Error: the Confluent CLI requires Java version 1.8 or 1.11.
See https://docs.confluent.io/current/installation/versions-interoperability.html
If you have multiple versions of Java installed, you may need to set JAVA_HOME to the version you want Confluent to use.

However, the only version of Java (installed through brew cask install java) on the machine (macOS High Sierra 10.13.6) is:

java --version
openjdk 14.0.2 2020-07-14
OpenJDK Runtime Environment (build 14.0.2+12-46)
OpenJDK 64-Bit Server VM (build 14.0.2+12-46, mixed mode, sharing)

Do you have any idea what could possibly go wrong here?

With kind regards, Andreas.

ewencp commented 4 years ago

The versions are validated because while things might work, we only actively support LTS versions because the rest of them drop updates too quickly (in 6mos), and it's generally more of a headache to determine that there was simply a compatibility issue and that there may be nothing wrong with the CLI or Confluent Platform components. Generally language and APIs are compatible, but other things like default GC settings, TLS versions and ciphers, etc are not necessarily. Even when 1.17 is available, which is the next LTS version, it's not necessarily going to work (and won't have been tested) against this version of the CLI. A flag to override this behavior might be nice though, for those that are adventurous and willing to debug issues that may arise.

wrt Homebrew, you should have more java options, they generally maintain some older stable versions under different names. In this case there should be a java11 package which is compatible (or openjdk@11 if you want the full jdk installed too).