分享

spark 与hive整合打包jar时报错java:[59,43] 错误: -source 1.6 中不支持 multi-ca...

yunge2016 发表于 2017-8-16 11:24:49 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 4 7179
请问一下: 现在做spark 与hive整合的时候,需要maven 打包jar 出现错误。eclipse --> maven build 报错:
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for sparklearn2:1609B04:jar:0.0.1-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 130, column 15
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]                                                                        
[INFO] ------------------------------------------------------------------------
[INFO] Building 1609B04 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ 1609B04 ---
[INFO] Deleting E:\spark_scala\1609B04\target
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ 1609B04 ---
[debug] execute contextualize
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory E:\spark_scala\1609B04\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ 1609B04 ---
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 21 source files to E:\spark_scala\1609B04\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] \spark_scala\1609B04\src\main\java\com\test\json\ObjectToJson.java:[59,43] 错误: -source 1.6 中不支持 multi-catch 语句
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.593s
[INFO] Finished at: Wed Aug 16 11:19:30 CST 2017
[INFO] Final Memory: 20M/329M
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "E:\maven\apache-maven-3.0.5\conf\settings.xml" could not be activated because it does not exist.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project 1609B04: Compilation failure
[ERROR] \spark_scala\1609B04\src\main\java\com\test\json\ObjectToJson.java:[59,43] 错误: -source 1.6 中不支持 multi-catch 语句
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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/confluen ... ojoFailureException

怎么回事呢,求助大家。maven 的jdk是默认的1.6

已有(4)人评论

跳转到指定楼层
SuperDove 发表于 2017-8-16 11:39:11
1.找到 file--》project structure ---》Modules --->Sources ---> Language level 改为 7.0就ok了。
2.你的spark版本是多少的,我记得spark1.6.0之后就要开始用jdk1.7+了
回复

使用道具 举报

yunge2016 发表于 2017-8-16 14:15:36
spark版本是cdh版的1.5.1 。用的是eclipse呀,没有那个project structure选项。不过现在解决啦。谢谢。是因为同一个项目下另外一个有问题,是因为不能同时catch 多个异常,移除了那个有问题的类就可以正常打包了。
回复

使用道具 举报

恋枫缩影 发表于 2017-8-17 11:26:54
yunge2016 发表于 2017-8-16 14:15
spark版本是cdh版的1.5.1 。用的是eclipse呀,没有那个project structure选项。不过现在解决啦。谢谢。是因 ...

你好,能给具体讲一下spark跟hive如何整合编译打包吗?谢谢!
回复

使用道具 举报

yunge2016 发表于 2017-8-18 15:58:00
是需要讲解详细的整合过程,还是说介绍一下编译打包的过程呢?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条