首页 > 解决方案 > 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

标签: javamavenapache-beam

解决方案


您需要使用Java 开发工具包 (JDK) 版本 8。验证 JAVA_HOME 环境变量是否已设置并指向您的 JDK 安装。

要更好地理解这一变化,请阅读:


推荐阅读