与星火,错误消息由Java执行Maven的 [英] Maven with Spark, Error message by the Java execution

查看:176
本文介绍了与星火,错误消息由Java执行Maven的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Eclipse在Eclipse中运行我的星火code和使用的工具Maven构建依赖关系。
目前,我有这种情况,当我有不从Eclipse平台运行我的code,但是从控制台(bash)的。我上传和安装Maven我的机器上的本地,并用不同的简单的例子播放。我的Maven的文件夹是在下载库。所有标准的例子都进行得非常顺利,我有一个正确的输出。我已经在本网站。
现在,我想也执行了火花code。我已经把我的后的Java文件的火花code在目录中,在那里我有其他的文件,更新的pom.xml,我不能建立我的jar文件。我已经得到了一个错误:

 用户@用户的HP-的ProBook-6570b:〜/火花1.4.0彬hadoop2.6 / Apache的行家-3.3.3 /我的应用$ MVN包-e
[INFO]错误踪迹已打开。
[INFO]扫描项目...
[信息]
[INFO] ----------------------------------------------- -------------------------
[INFO]构建测试0.0.1-SNAPSHOT
[INFO] ----------------------------------------------- -------------------------
[信息]
[信息] --- Maven的资源 - 插件:2.3:资源(缺省资源)@ CTI ---
[信息]使用UTF-8编码复制过滤资源。
[信息]跳到不存在的resourceDirectory /home/user/spark-1.4.0-bin-hadoop2.6/apache-maven-3.3.3/my-app/src/main/resources
[信息]
[信息] --- Maven的编译器插件:2.0.2:编译(默认编译)@ CTI ---
[INFO]将源文件编译为/home/user/spark-1.4.0-bin-hadoop2.6/apache-maven-3.3.3/my-app/target/classes
[INFO] ----------------------------------------------- -------------------------
[INFO]构建失败
[INFO] ----------------------------------------------- -------------------------
[INFO]总时间:2.728s
[INFO]在表面处理:周一10月26日十五点十八分52秒CET 2015年
[INFO]最后的内存:14M / 167M
[INFO] ----------------------------------------------- -------------------------
[错误]未能执行目标org.apache.maven.plugins:Maven的编译器插件:2.0.2:编译(默认编译)项目CTI:编译失败
[错误] /home/user/spark-1.4.0-bin-hadoop2.6/apache-maven-3.3.3/my-app/src/main/java/app/SimpleApp.java:[12,11]错误:泛型是不-source 1.3支持
[错误] - > [求助1]
org.apache.maven.lifecycle.LifecycleExecutionException:未能执行目标org.apache.maven.plugins:Maven的编译器插件:2.0.2:编译(默认编译)项目CTI:编译失败
/home/user/spark-1.4.0-bin-hadoop2.6/apache-maven-3.3.3/my-app/src/main/java/app/SimpleApp.java:[12,11]错误:泛型是不-source 1.3支持
    在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
    在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    在org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    在org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    在org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    在org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    在org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    在org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    在org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    在org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    在org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)
    在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    在java.lang.reflect.Method.invoke(Method.java:497)
    在组织。codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    在组织。codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    在组织。codehaus.plexus.classworlds.launcher.Launcher.mainWithExit code(Launcher.java:415)
    在组织。codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
org.apache.maven.plugin.CompilationFailureException:引起编译失败
/home/user/spark-1.4.0-bin-hadoop2.6/apache-maven-3.3.3/my-app/src/main/java/app/SimpleApp.java:[12,11]错误:泛型是不-source 1.3支持
    在org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:516)
    在org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114)
    在org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    ... 19个
[错误]
[错误]使用-X开关启用完全调试日志记录重新运行Maven。
[错误]
[错误]有关错误和可能的解决方案,请阅读以下文章了解更多信息:
[错误] [说明1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

我怎么理解,就是一切毛病我星火版本。我目前使用的火花1.4.0版本。我还张贴我的pom.xml文件:

 <项目的xmlns =htt​​p://maven.apache.org/POM/4.0.0的xmlns:XSI =htt​​p://www.w3.org/2001 / XML模式实例
  XSI:的schemaLocation =htt​​p://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">
  < modelVersion> 4.0.0< / modelVersion>  <&的groupId GT;原型和LT; /的groupId>
  <&的artifactId GT; CTI< / artifactId的>
  <&版GT; 0.0.1-SNAPSHOT< /版本>
  <包装和GT;&罐子LT; /包装>  <名称>测试与LT; /名称>
  &LT; URL&GT; HTTP://maven.apache.org< / URL&GT;  &LT;性状&gt;
    &LT; project.build.sourceEncoding&GT; UTF-8&LT; /project.build.sourceEncoding>
  &LT; /性状&gt; &LT;依赖和GT;
  &LT;&依赖性GT; &LT;! - 星火依赖 - &GT;
      &LT;&的groupId GT; org.apache.spark&LT; /的groupId&GT;
      &LT;&的artifactId GT;火花core_2.10&LT; / artifactId的&GT;
      &LT;&版GT; 1.4.0&LT; /版本&GT;
    &LT; /依赖性&GT;
  &LT; /依赖和GT;
&LT; /项目&GT;

关于在错误信息底部的链接的文件是不是行家的错误的但蹊跷的是插件。


解决方案

根据你的错误日志,你需要在你的maven java编译器版本设置为您正在使用(1.7或1.8)相应的Java版本。看来你的Maven是使用旧版本的Java(1.3)

 &LT;性状&gt;
  &LT; maven.compiler.source&GT; 1.8 LT; /maven.compiler.source>
  &LT; maven.compiler.target&GT; 1.8 LT; /maven.compiler.target>
&LT; /性状&gt;

这是给了错误了行:

<$p$p><$c$c>spark-1.4.0-bin-hadoop2.6/apache-maven-3.3.3/my-app/src/main/java/app/SimpleApp.java:[12,11]错误:泛型是不-source 1.3支持

I use Eclipse to run my Spark code and use tool Maven in Eclipse to build the dependencies. Currently I have the situation, when I have to run my code not from Eclipse platform, but from console (bash). I upload and install Maven local on my machine and was playing with the different simple examples. My Maven folder is in Downloads repository. All standard examples are going very well, I have got a right output. All introductions I have found on this site. Now I want also execute a spark code. After I have placed my Java file with the spark code in the directory, where I have other files, and updated pom.xml, I couldn't build my jar file. I have got the next error:

user@user-HP-ProBook-6570b:~/spark-1.4.0-bin-hadoop2.6/apache-maven-3.3.3/my-app$ mvn package -e
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Test 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.3:resources (default-resources) @ CTI ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/user/spark-1.4.0-bin-hadoop2.6/apache-maven-3.3.3/my-app/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.0.2:compile (default-compile) @ CTI ---
[INFO] Compiling 1 source file to /home/user/spark-1.4.0-bin-hadoop2.6/apache-maven-3.3.3/my-app/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.728s
[INFO] Finished at: Mon Oct 26 15:18:52 CET 2015
[INFO] Final Memory: 14M/167M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project CTI: Compilation failure
[ERROR] /home/user/spark-1.4.0-bin-hadoop2.6/apache-maven-3.3.3/my-app/src/main/java/app/SimpleApp.java:[12,11] error: generics are not supported in -source 1.3
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project CTI: Compilation failure
/home/user/spark-1.4.0-bin-hadoop2.6/apache-maven-3.3.3/my-app/src/main/java/app/SimpleApp.java:[12,11] error: generics are not supported in -source 1.3


    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
/home/user/spark-1.4.0-bin-hadoop2.6/apache-maven-3.3.3/my-app/src/main/java/app/SimpleApp.java:[12,11] error: generics are not supported in -source 1.3


    at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:516)
    at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    ... 19 more
[ERROR] 
[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 read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

How I understand, is everything wrong with my Spark version. I use currently spark 1.4.0 version. I also post my pom.xml file:

<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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>Prototype</groupId>
  <artifactId>CTI</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>Test</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

 <dependencies>
  <dependency> <!-- Spark dependency -->
      <groupId>org.apache.spark</groupId>
      <artifactId>spark-core_2.10</artifactId>
      <version>1.4.0</version>
    </dependency>
  </dependencies>
</project>

Regarding the documentation in the link at the bottom of error message it is not a error of maven, but something wrong is with plugin.

解决方案

According to you error log, you need to set your java compiler version in maven to the corresponding java version you are using (1.7 or 1.8). It seems that your maven is using a old version of Java (1.3)

<properties>
  <maven.compiler.source>1.8</maven.compiler.source>
  <maven.compiler.target>1.8</maven.compiler.target>
</properties>

This is the line that gave the error up :

spark-1.4.0-bin-hadoop2.6/apache-maven-3.3.3/my-app/src/main/java/app/SimpleApp.java:[12,11] error: generics are not supported in -source 1.3

这篇关于与星火,错误消息由Java执行Maven的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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