You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Akira Ajisaka (JIRA)" <ji...@apache.org> on 2017/06/24 15:56:00 UTC

[jira] [Commented] (HADOOP-14586) org.apache.hadoop.util.Shell causes failure in on Java 9 RC build, leading to almost all of Hadoop failing (next one StringUtils)

    [ https://issues.apache.org/jira/browse/HADOOP-14586?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16062039#comment-16062039 ] 

Akira Ajisaka commented on HADOOP-14586:
----------------------------------------

This code was removed by HADOOP-10775 and it does not fail in 2.8.0+

>  org.apache.hadoop.util.Shell causes failure in <clinit> on Java 9 RC build, leading to almost all of Hadoop failing (next one StringUtils)
> -------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-14586
>                 URL: https://issues.apache.org/jira/browse/HADOOP-14586
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: common
>         Environment: Java 9, build 175 (Java 9 release candidate as of June 25th, 2017)
>            Reporter: Uwe Schindler
>            Priority: Critical
>              Labels: Java9
>
> You cannot use any Hadoop 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:
> {code:java}
>   private static boolean IS_JAVA7_OR_ABOVE =
>       System.getProperty("java.version").substring(0, 3).compareTo("1.7") >= 0;
> {code}
> Analysis:
> - This code looks wrong, as comparing a version this way is incorrect.
> - The {{substring(0, 3)}} is completely useless, {{compareTo}} also works without it, although it is still an invalid way to compare a version.
> Maybe look at Lucene's source code (Constants.java) to have a better way in doing this! Sorry this is incredible to me! Hardcoding string bounds into a static initializer that are applied on a string that you have no control of...
> This issue breaks Apache Solr from working with Java 9, so I set it to "critical". We have to disable the whole Hadoop integration once Java 9 is detected.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org