简体   繁体   English

尝试编译hadoop mapreduce示例时出现gcj错误

[英]gcj error when trying to compile hadoop mapreduce examples

I am trying to use gcj on hadoop-mapreduce-examples-2.7.1.jar to generate native machine code from the jar file. 我试图在hadoop-mapreduce-examples-2.7.1.jar上使用gcj从jar文件生成本机代码。 I need this for my research. 我的研究需要这个。 But I am getting error: expected type 'java.lang.Throwable' but stack contains 'java.io.IOException' 但是我遇到了错误: 预期类型为“ java.lang.Throwable”,但是堆栈包含“ java.io.IOException”

I have gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04) and the command I used is to do this is: 我有gcc版本4.8.4(Ubuntu 4.8.4-2ubuntu1〜14.04),我使用的命令是:

gcj --classpath={hadoop-mapreduce-client-core-2.7.1.jar:hadoop-common-2.7.1.jar:commons-cli-1.2.jar:commons-logging-1.1.3.jar:guava-11.0.2.jar:hsqldb-2.0.0.jar} -d {destination} hadoop-mapreduce-examples-2.7.1.jar

Since I am beginner with java, I am not sure if I am on the right path or not. 因为我是Java的初学者,所以我不确定自己是否走对了。 I am not even sure if this is possible. 我什至不确定这是否可行。 Please suggest. 请提出建议。

Does adding -findirect-dispatch flag works for you? 添加-findirect-dispatch标志对您-findirect-dispatch吗?

Notice you can also add -O1 , -O2 or -O3 optimization flag. 注意,您还可以添加-O1-O2-O3优化标志。 In my case, -O1 actually works best, but you have to test for yourself. 就我而言, -O1实际上效果最好,但是您必须自己进行测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM