42

シェルcleanJarでは、Impatient/part1ディレクトリにgradleと入力しました。出力は以下のとおりです。エラーは「org.apache.hadoop.mapred.JobConfのクラスファイルが見つかりません」です。なぜコンパイルに失敗したのですか?

:clean UP-TO-DATE
:compileJava
Download http://conjars.org/repo/cascading/cascading-core/2.0.1/cascading-core-2.0.1.pom
Download http://conjars.org/repo/cascading/cascading-hadoop/2.0.1/cascading-hadoop-2.0.1.pom
Download http://conjars.org/repo/riffle/riffle/0.1-dev/riffle-0.1-dev.pom
Download http://repo1.maven.org/maven2/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1.pom
Download http://repo1.maven.org/maven2/org/slf4j/slf4j-parent/1.6.1/slf4j-parent-1.6.1.pom
Download http://repo1.maven.org/maven2/org/slf4j/slf4j-log4j12/1.6.1/slf4j-log4j12-1.6.1.pom
Download http://conjars.org/repo/thirdparty/jgrapht-jdk1.6/0.8.1/jgrapht-jdk1.6-0.8.1.pom
Download http://repo1.maven.org/maven2/org/codehaus/janino/janino/2.5.16/janino-2.5.16.pom
Download http://conjars.org/repo/cascading/cascading-core/2.0.1/cascading-core-2.0.1.jar
Download http://conjars.org/repo/cascading/cascading-hadoop/2.0.1/cascading-hadoop-2.0.1.jar
Download http://conjars.org/repo/riffle/riffle/0.1-dev/riffle-0.1-dev.jar
Download http://repo1.maven.org/maven2/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1.jar
Download http://repo1.maven.org/maven2/org/slf4j/slf4j-log4j12/1.6.1/slf4j-log4j12-1.6.1.jar
Download http://conjars.org/repo/thirdparty/jgrapht-jdk1.6/0.8.1/jgrapht-jdk1.6-0.8.1.jar
Download http://repo1.maven.org/maven2/org/codehaus/janino/janino/2.5.16/janino-2.5.16.jar
/home/is_admin/lab/cascading/Impatient/part1/src/main/java/impatient/Main.java:50: error: cannot access JobConf
    Tap inTap = new Hfs( new TextDelimited( true, "\t" ), inPath );
                ^
  class file for org.apache.hadoop.mapred.JobConf not found
1 error
:compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 22.599 secs
4

5 に答える 5

1

hadoop ディストリビューションからパスに hadoop-core-1.xyjar を追加します。

これは、CoPA の例でうまくいきました。Eclipseビルドパスに追加しました。

これをgradleの依存関係に追加{}セクション

コンパイル (グループ: 'org.apache.hadoop'、名前: 'hadoop-core'、バージョン: '1.2.0')

于 2013-10-13T09:34:10.537 に答える
0

Lalitに感謝します。以下の行を追加すると、Javaバージョンを変更する必要がなく、うまくいきました..

compile( group: 'org.apache.hadoop', name: 'hadoop-core', version: '1.2.0' )

または、hadoop-core jar をクラス パスに追加して、gradle パスで言及することもできます。

于 2015-08-09T07:04:09.910 に答える
0

クラスが見つからないようです。ビルド パス エントリのライブラリを確認してください。

于 2013-10-05T09:49:16.923 に答える