java - Apache Beam 执行
问题描述
我正在关注此示例,但在步骤中:运行 WordCount,通过直接命令
$ mvn compile exec:java -Dexec.mainClass=org.apache.beam.examples.WordCount \
-Dexec.args="--inputFile=pom.xml --output=counts" -Pdirect-runner
最后我有这个错误:
[INFO] -----------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.065 s
[INFO] Finished at: 2018-10-02T17:36:05+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (default-cli) on project word-count-beam: An exception occured while executing the Java class. java.lang.UnsupportedOperationException: Cannot define class using reflection: Could not find sun.misc.Unsafe -> [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] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
解决方案
您需要使用Java 开发工具包 (JDK) 版本 8。验证 JAVA_HOME 环境变量是否已设置并指向您的 JDK 安装。
要更好地理解这一变化,请阅读:
推荐阅读
- python - 为什么我的数据在使用拆分功能时没有转换为浮点类型。#python3
- angular - Angular ServiceWorker 推送通知不起作用
- java - Spring Boot - 确保数据属于当前登录用户
- python - numpy.ndarray' 对象没有属性 'append' - 使用 numpy 创建堆栈时出现错误
- php - PHP:使用外键更新数据
- python-3.x - 如何使用连接组件opencv python计算倾斜文档的倾斜斜率?
- python - 键入 Python3 或 Python3.6 给我一个错误
- javascript - R 传单中的集群选项 pi 图表
- c++ - C ++在包含某些字母的字符串向量中查找名称
- javascript - 我想选择 2 个不同的输入(单选按钮)并划分它们的值并将结果显示为警报