无法使用Java8构建Hadoop 2.4.1 [英] Can't build Hadoop 2.4.1 with Java8

查看:352
本文介绍了无法使用Java8构建Hadoop 2.4.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题非常简单。我正在尝试使用以下命令在Windows上编译Hadoop2.4.1:

  mvn clean package -Pdist,native-win  - DskipTests -Dtar 

使用 JAVA_HOME = C:\Program Files \ Java \ _jdk1.7.0_51 ,它运行正常。



使用 JAVA_HOME = C:\Program Files \ Java \ _jdk1.8.0_05 ,它没有并且未能给我以下错误:

  [INFO] Apache Hadoop注释......................... FAILURE [4.086s] 
---
[错误] ]无法执行目标org.apache.maven.plugins:maven-javadoc-plugin:2.8
.1:jar(module-javadocs)项目hadoop-annotations:MavenReportException:Er
ror创建归档时:
[错误]退出代码:1 - C:\ hadoop-src \ hadoop-common-project \ hadoop-annotations\sr
c \ main \ javaa \\\ apache\hadoop\classification\InterfaceStability.java:27:error:b
意外结束ag:< / ul>
[错误] *< / ul>
[错误] ^
[错误]
[错误]命令行是:C:\Program Files \Java \ _jdk1.8.0_05 \\\\\ \\ _b \\ _ $ javadoc。
exe-J-Dhttp.proxySet = true -J-Dhttp.proxyHost = proxy -J-Dhttp.proxyPort = 3128 @op
tions @packages
[ ERROR]
[错误]请参阅'C:\ hadoop-src \ hadoop-common-pro
ject \ hadoop-annotations \ target'dir中生成的Javadoc文件。
[错误] - > [帮助1]
[错误]
[错误]要查看错误的完整堆栈跟踪,请使用-e swit
ch重新运行Maven。
[错误]使用-X开关重新运行Maven以启用完整的调试日志记录。
[错误]
[错误]有关错误和可能解决方案的更多信息,请参阅以下文章:
[错误] [帮助1] http:// cwiki .apache.org / confluence / display / MAVEN / MojoExecutionE
xception
[错误]

如前所述,除了 JAVA_HOME 之外,我没有更改。错误消息似乎表明该错误与代理相关,但我不知道为什么。



在这两种情况下,我都有

  C:\ hadoop-src> javac -version 
javac 1.8.0_05

  C:\ hadoop-src> java -version 
java版本1.8.0_05
Java(TM)SE运行时环境(版本1.8.0_05-b13)
Java HotSpot(TM)64位服务器VM(版本25.5-b02,混合模式)

你们有没有关于发生了什么的线索?

解决方案

这是javadoc报告的错误。 Java 8中的javadoc版本比早期版本中的版本严格得多。如果它检测到它认为是无效标记的内容,它现在发出错误信号,包括存在不期望的结束标记。



关闭此检查在javadoc中,将 -Xdoclint:none 标志添加到javadoc命令行。有关如何在maven环境中执行此操作的信息,请参阅 Stephen Colebourne关于此主题的博客文章。具体来说,添加

 < additionalparam> -Xdoclint:none< / additionalparam> 

到适当的属性或配置文件。



<但是,有一些奇怪的事情正在发生。 此文件的当前(主干)版本似乎在正确的位置有< / ul> 结束标记。 此文件的历史记录表示最近添加了以前丢失的结束标记,但它似乎确实在Hadoop 2.4中。此文件本身由JDK 8u5 javadoc成功处理,无需抑制任何错误。



是否已在某处添加了以前缺少<$ c的补丁$ c>< / ul> 结束标记,由于结束标记已添加到原始来源,现在是多余的?额外的结束标记会导致javadoc因此错误而失败。



更新



我一直在看错了分支。 此文件的2.4.1版本显然有一个额外的< / ul> 结束标记。关于错误补丁的猜想是对的。主干上文件的历史记录表明,HADOOP-8059在2012年6月添加了一堆javadoc评论。这些新增内容缺少< / ul> 结束标记。 2014年1月,HADOOP-10320添加了缺失的结束标记。 HADOOP-10320的贴片移植到2.4.1分支,但HADOOP-8059的新javadocs未移植,导致标记格式错误。


The problem is pretty straight-forward. I'm trying to compile Hadoop2.4.1 on windows with the following command :

mvn clean package -Pdist,native-win -DskipTests -Dtar

With JAVA_HOME=C:\Program Files\Java\jdk1.7.0_51, it works fine.

With JAVA_HOME=C:\Program Files\Java\jdk1.8.0_05, it doesn't and fails giving me the following error :

[INFO] Apache Hadoop Annotations ......................... FAILURE [4.086s]
---
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.8
.1:jar (module-javadocs) on project hadoop-annotations: MavenReportException: Er
ror while creating archive:
[ERROR] Exit code: 1 - C:\hadoop-src\hadoop-common-project\hadoop-annotations\sr
c\main\java\org\apache\hadoop\classification\InterfaceStability.java:27: error:
unexpected end tag: </ul>
[ERROR] * </ul>
[ERROR] ^
[ERROR]
[ERROR] Command line was: "C:\Program Files\Java\jdk1.8.0_05\jre\..\bin\javadoc.
exe" -J-Dhttp.proxySet=true -J-Dhttp.proxyHost=proxy -J-Dhttp.proxyPort=3128 @op
tions @packages
[ERROR]
[ERROR] Refer to the generated Javadoc files in 'C:\hadoop-src\hadoop-common-pro
ject\hadoop-annotations\target' dir.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
xception
[ERROR]

As stated before, I changed nothing else than JAVA_HOME. The error message seems to indicate that the error is proxy related, but I have no idea why.

In both case, I have

C:\hadoop-src>javac -version
javac 1.8.0_05

and

C:\hadoop-src>java -version
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)

Would you folks have any clues on what's going on ?

解决方案

This is an error reported by javadoc. The javadoc version in Java 8 is considerably more strict than the one in earlier version. It now signals an error if it detects what it considers to be invalid markup, including the presence of an end tag where one isn't expected.

To turn off this checking in javadoc, add the -Xdoclint:none flag to the javadoc command line. For information about how to do this in a maven environment, see Stephen Colebourne's blog entry on this topic. Specifically, add

<additionalparam>-Xdoclint:none</additionalparam>

to an appropriate properties or configuration file.

There are a couple weird things going on, though. The current (trunk) version of this file seems to have the </ul> end tag in the right place. The history of this file indicates that the previously-missing end tag was added fairly recently, but it does appear to be in Hadoop 2.4. And this file by itself is processed successfully by JDK 8u5 javadoc, without having to suppress any errors.

Has a patch been applied somewhere that added the formerly-missing </ul> end tag, which is now redundant since the end tag has been added to the original source? An extra end tag will cause javadoc to fail with this error.

UPDATE

I had been looking at the wrong branch. The 2.4.1 version of this file clearly has an extra </ul> end tag. My conjecture about an errant patch was sort-of right. The history of the file on the trunk shows that a bunch of javadoc comments were added back in June 2012 by HADOOP-8059. These new additions were missing the </ul> end tag. In January 2014, HADOOP-10320 added the missing end tag. The patch for HADOOP-10320 was transplanted to the 2.4.1 branch, but the new javadocs from HADOOP-8059 were not transplanted, resulting in malformed markup.

这篇关于无法使用Java8构建Hadoop 2.4.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆