riptano / ccm

A script to easily create and destroy an Apache Cassandra cluster on localhost
Apache License 2.0
1.21k stars 299 forks source link

Cassandra 19636 #768

Closed jacek-lewandowski closed 1 month ago

jacek-lewandowski commented 1 month ago

The logic works as follows:

  1. Look for available Java versions in the env - figure out versions of Java located at JAVA_HOME and all JAVAx_HOME env vars (actually execute java -version to check)

  2. Figure out supported Java versions by Cassandra distribution - for Cassandra 5.1+ binary distribution the supported Java versions can be read from cassandra.in.sh and for Cassandra 5.0+ source distribution the supported Java versions can be read from build.xml. For other Cassandra versions, the supported Java versions are hardcoded in CCM

  3. If Java version is explicitly provided - use it if it is available (see 1), warn if it is not supported by Cassandra

  4. If JAVA_HOME is defined, use that Java distribution if it is supported by Cassandra distribution; if it is not supported, select the closest supported (see 2) and available (see 1) Java version

  5. If JAVA_HOME is not defined, use the highest supported (see 2) and available (see 1) Java version

Also, if Java is available on the PATH, JAVA_HOME must be defined as well and both must refer to the same Java version. Fail if Java is available on the PATH and there is no JAVA_HOME or if JAVA_HOME refers a different Java version than Java defined on the PATH.

Also,

michaelsembwever commented 1 month ago

CI results attached to jira ticket.