Parsing of Java version is done in cassandra-env.sh via
This fails if the first line of output from `java -version` does not contain the version. When JAVA_TOOL_OPTIONS is set as the output is
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
java version "1.7.0_40"
Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
Java HotSpot(TM) 64-Bit Server VM (build 24.0-b56, mixed mode)
Parsing this is not guaranteed to work as there is no contract for this output. The recommended way of dealing with this is via a Java application (which will have access to each of these pieces).
If you want to keep with this model of doing things, you can apply a very small but hacky patch:
Otherwise, you need to write a java app, compiled for older versions, that returns this data via the java.specification.version and a combination of java.vm.name and java.vm.vendor.