Bug #18537
closedClarify Java version check
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1422324
Description of problem:
/usr/share/katello-installer-base/hooks/pre/15-check_java.rb checks for OpenJDK version >= 1.7 but error message says OpenJDK version should be > 1.7
Version-Release number of selected component (if applicable):
6.2.7
How reproducible:
100%
Steps to Reproduce:
1. Examine /usr/share/katello-installer-base/hooks/pre/15-check_java.rb
Actual results:
JAVA_VERSION = %q(An OpenJDK version of Java greater than 1.7 should be installed. For more
details on the version currently installed, run 'java -version')
OPENJDK = %q(A version of java which is not OpenJDK is installed.
Please install an OpenJDK version greater than 1.7 and make sure it
was set as the default java using
alternatives --config java
For more details on the version currently installed, run 'java -version'.)
Expected results:
JAVA_VERSION = %q(An OpenJDK version of Java greater than or equal to 1.7 should be installed. For more
details on the version currently installed, run 'java -version')
OPENJDK = %q(A version of java which is not OpenJDK is installed.
Please install an OpenJDK version greater than or equal to 1.7 and make sure it
was set as the default java using
alternatives --config java
For more details on the version currently installed, run 'java -version'.)
Additional info:
Actual check is:
if Kafo::Helpers.module_enabled?(@kafo, 'katello')
java_version_string = `/usr/bin/java -version 2>&1`
java_version = java_version_string.split("\n")[0].split('"')[1]
- Check that OpenJDK 1.7 or higher is installed if any java is installed
if java_version
error_exit(JAVA_VERSION, 1) if java_version < "1.7"
error_exit(OPENJDK, 2) unless java_version_string.include? "OpenJDK"
end
end