1
我是Hadoop的新手。最近我正在研究Hadoop2.6.0(Yarn)。現在,我想學習一個簡單的紗線應用程序。我發現this simple yarn app。 但可悲的是,當我運行mvn package
,它顯示了這樣的錯誤:如何使用MVN構建hortonworks/simple-yarn-app
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project simple-yarn-app: Compilation failure: Compilation failure:
[ERROR] /home/user/simple-yarn-app/src/main/java/com/hortonworks/simpleyarnapp/ApplicationMaster.java:[30,14] error: generics are not supported in -source 1.3
[ERROR]
[ERROR] (use -source 5 or higher to enable generics)
[ERROR] /home/user/simple-yarn-app/src/main/java/com/hortonworks/simpleyarnapp/ApplicationMaster.java:[64,33] error: enhanced for loops are not supported in -source 1.3
[ERROR]
[ERROR] (use -source 5 or higher to enable for-each loops)
[ERROR] /home/user/simple-yarn-app/src/main/java/com/hortonworks/simpleyarnapp/Client.java:[72,7] error: generics are not supported in -source 1.3
[ERROR]
[ERROR] (use -source 5 or higher to enable generics)
[ERROR] /home/user/simple-yarn-app/src/main/java/com/hortonworks/simpleyarnapp/Client.java:[121,18] error: enhanced for loops are not supported in -source 1.3
[ERROR]
[ERROR] (use -source 5 or higher to enable for-each loops)
[ERROR] /home/user/simple-yarn-app/src/main/java/com/hortonworks/simpleyarnapp/ApplicationMasterAsync.java:[35,42] error: generics are not supported in -source 1.3
[ERROR]
[ERROR] (use -source 5 or higher to enable generics)
[ERROR] /home/user/simple-yarn-app/src/main/java/com/hortonworks/simpleyarnapp/ApplicationMasterAsync.java:[36,33] error: enhanced for loops are not supported in -source 1.3
而我MVN的版本是:
Apache Maven 3.0.5
Maven home: /usr/share/maven
Java version: 1.8.0_31, vendor: Oracle Corporation
Java home: /usr/lib/jvm/jdk1.8.0_31/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-45-generic", arch: "amd64", family: "unix"
的pom.xml的是在這裏:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.hortonworks</groupId>
<artifactId>simple-yarn-app</artifactId>
<version>1.1.0</version>
<name>simple-yarn-app</name>
<url>https://github.com/hortonworks/simple-yarn-app</url>
<dependencies>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-yarn-client</artifactId>
<version>2.6.0</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<version>2.6.0</version>
</dependency>
</dependencies>
</project>
我該如何解決這個問題?