error when building HIPI helloworld program

142 views
Skip to first unread message

Phanindra Reddy

unread,
Feb 23, 2016, 8:44:17 PM2/23/16
to HIPI Users
hduser@sagar-Inspiron-3542:~/examples/helloWorld$ gradle jar

FAILURE: Build failed with an exception.

* Where:
Build file '/home/hduser/examples/helloWorld/build.gradle' line: 1

* What went wrong:
A problem occurred evaluating root project 'helloWorld'.
> Could not find method jar() for arguments [build_6266dqvoc8lxxbdh2crmgyohb$_run_closure1@6be42bcf] on root project 'helloWorld'.

* 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: 7.618 secs


can anyone help me on this
thankyou

Rahul Shah

unread,
Mar 4, 2016, 12:19:05 AM3/4/16
to HIPI Users
try adding "apply plugin: java" to build.gradle

Phanindra Reddy

unread,
Mar 5, 2016, 2:02:39 AM3/5/16
to HIPI Users
thank you Rahul Shah for your suggesion but this gives the following error even though i added hadoop-common-2.7.1.jar as a classpath
hduser@sagar-Inspiron-3542:~/examples/helloWorld$ gradle jar
:compileJava
/home/hduser/examples/helloWorld/src/main/java/org/hipi/examples/HelloWorld.java:3: error: package org.apache.hadoop.conf does not exist
import org.apache.hadoop.conf.Configured;
                             ^
/home/hduser/examples/helloWorld/src/main/java/org/hipi/examples/HelloWorld.java:4: error: package org.apache.hadoop.util does not exist
import org.apache.hadoop.util.Tool;
                             ^
/home/hduser/examples/helloWorld/src/main/java/org/hipi/examples/HelloWorld.java:5: error: package org.apache.hadoop.util does not exist
import org.apache.hadoop.util.ToolRunner;
                             ^
/home/hduser/examples/helloWorld/src/main/java/org/hipi/examples/HelloWorld.java:7: error: cannot find symbol
public class HelloWorld extends Configured implements Tool {
                                ^
  symbol: class Configured
/home/hduser/examples/helloWorld/src/main/java/org/hipi/examples/HelloWorld.java:7: error: cannot find symbol
public class HelloWorld extends Configured implements Tool {
                                                      ^
  symbol: class Tool
/home/hduser/examples/helloWorld/src/main/java/org/hipi/examples/HelloWorld.java:15: error: cannot find symbol
    ToolRunner.run(new HelloWorld(), args);
    ^
  symbol:   variable ToolRunner
  location: class HelloWorld
6 errors
: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: 5.616 secs

Rahul Shah

unread,
Mar 5, 2016, 2:32:22 AM3/5/16
to hipi-...@googlegroups.com
How are you adding the jar to the classpath? using gradle or libjar option?


Regards,
Rahul Shah

Piyush Jha

unread,
Jun 8, 2018, 6:36:47 AM6/8/18
to HIPI Users
 did you solve the problem?I am also getting same problem.pls share if you solved it..

Piyush Jha

unread,
Jun 8, 2018, 6:46:28 AM6/8/18
to HIPI Users


somebody pls help me with this
Screenshot from 2018-06-08 16-14-59.png

Swapna Patil

unread,
Oct 21, 2018, 11:56:48 AM10/21/18
to HIPI Users
1) Create a folder lib under examples/HelloWorld/lib and copy the following files (depending on your Hadoop version) into the lib folder:
- hadoop-common-2.8.4.jar
- hadoop-common-2.8.4-tests.jar
- hadoop-nfs-2.8.4.jar

2) Terminal: hadoop@master:~/examples/helloWorld$ gradle init

3) Now, edit the build.gradle file:

apply plugin: 'java'
dependencies {
    compile files(fileTree(dir: 'lib', includes: ['*.jar']))
}
jar {
  manifest {
    attributes("Main-Class": "org.hipi.examples.HelloWorld")
  }
  from configurations.runtime.collect { zipTree(it) }
}


4) This is what my settings.gradle file looks like:
rootProject.name = 'helloWorld'

5) Terminal: hadoop@master:~/examples/helloWorld$  gradle jar

6) Terminal: hadoop@master:~/examples/helloWorld$  hadoop jar build/libs/helloWorld.jar
Reply all
Reply to author
Forward
0 new messages