Details
Description
You cannot use any pre-Hadoop 2.8 component anymore with the latest release candidate build of Java 9, because it fails with an StringIndexOutOfBoundsException in org.apache.hadoop.util.Shell#<clinit>. This leads to a whole cascade of failing classes (next in chain is StringUtils).
The reason is that the release candidate build of Java 9 no longer has "-ea" in the version string and the system property "java.version" is now simply "9". This causes the following line to fail fatally:
private static boolean IS_JAVA7_OR_ABOVE = System.getProperty("java.version").substring(0, 3).compareTo("1.7") >= 0;
Analysis:
- This code looks wrong, as comparing a version this way is incorrect.
- The substring(0, 3) is not needed, compareTo also works without it, although it is still an invalid way to compare a version.
Attachments
Attachments
Issue Links
- breaks
-
SOLR-10966 Add workaround for Hadoop-Common 2.7.2 incompatibility with Java 9
- Resolved
-
SOLR-10951 Update Hadoop dependencies to 2.8.1, so Solr works with Java 9
- Closed
- duplicates
-
HADOOP-10775 Shell operations to fail with meaningful errors on windows if winutils.exe not found
- Resolved
- is depended upon by
-
SOLR-11261 Update to Hadoop 2.7.4
- Closed
- relates to
-
HADOOP-11123 Fix Java 9 incompatibilies in Hadoop
- Resolved