Open ecsho opened 8 years ago
Hi, add compile files('libs/hipi-2.1.0.jar') to your dependencies in build.gradle file.
I am facing the same issue. Can anyone help me out here
add dependencies{ compile project(':core') }
you need to add dependencies in build.gradle file in your helloWorld project. Here is the code:
jar {
manifest {
attributes("Main-Class": "org.hipi.examples.HelloWorld")
}
dependencies{
compile project(':core')
}
from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
}
hope it works
I was facing the same problem @ashishkumar4029 : your solution worked for me. I am new to gradle and I do not understand it a much. can you please explain what this script means?
I'm using Hipi 2.1, Hadoop 2.6.0 and OpenCV 2.4.11. The simple helloWorld (i.e. just echo a message) could be built with gradle and executed successfully. However, the complex helloWorld (i.e. include map reduce function and import HIPI library in the top of the helloWorld program) is unable to build with gradle. The error messages state that org.hipi.image and org.hipi.imagebundle do not exist.
Pls. enlight how to diagnosis and fix this issue.
hduser@ip-172-31-25-72:/opt/hipi/examples/helloWorld$ gradle jar :examples:helloWorld:compileJava /opt/hipi/examples/helloWorld/src/main/java/org/hipi/examples/HelloWorld.java:3: error: package org.hipi.image does not exist import org.hipi.image.FloatImage; ^ /opt/hipi/examples/helloWorld/src/main/java/org/hipi/examples/HelloWorld.java:4: error: package org.hipi.image does not exist import org.hipi.image.HipiImageHeader; ^ /opt/hipi/examples/helloWorld/src/main/java/org/hipi/examples/HelloWorld.java:5: error: package org.hipi.imagebundle.mapreduce does not exist import org.hipi.imagebundle.mapreduce.HibInputFormat; ^ /opt/hipi/examples/helloWorld/src/main/java/org/hipi/examples/HelloWorld.java:25: error: cannot find symbol public static class HelloWorldMapper extends Mapper<HipiImageHeader, FloatImage, IntWritable, FloatImage> { ^ symbol: class HipiImageHeader location: class HelloWorld /opt/hipi/examples/helloWorld/src/main/java/org/hipi/examples/HelloWorld.java:25: error: cannot find symbol public static class HelloWorldMapper extends Mapper<HipiImageHeader, FloatImage, IntWritable, FloatImage> { ^ symbol: class FloatImage location: class HelloWorld /opt/hipi/examples/helloWorld/src/main/java/org/hipi/examples/HelloWorld.java:25: error: cannot find symbol public static class HelloWorldMapper extends Mapper<HipiImageHeader, FloatImage, IntWritable, FloatImage> { ^ symbol: class FloatImage location: class HelloWorld /opt/hipi/examples/helloWorld/src/main/java/org/hipi/examples/HelloWorld.java:27: error: cannot find symbol public void map(HipiImageHeader key, FloatImage value, Context context) ^ symbol: class HipiImageHeader location: class HelloWorldMapper /opt/hipi/examples/helloWorld/src/main/java/org/hipi/examples/HelloWorld.java:27: error: cannot find symbol public void map(HipiImageHeader key, FloatImage value, Context context) ^ symbol: class FloatImage location: class HelloWorldMapper /opt/hipi/examples/helloWorld/src/main/java/org/hipi/examples/HelloWorld.java:68: error: cannot find symbol public static class HelloWorldReducer extends Reducer<IntWritable, FloatImage, IntWritable, Text> { ^ symbol: class FloatImage location: class HelloWorld /opt/hipi/examples/helloWorld/src/main/java/org/hipi/examples/HelloWorld.java:70: error: cannot find symbol public void reduce(IntWritable key, Iterable values, Context context)
^
symbol: class FloatImage
location: class HelloWorldReducer
/opt/hipi/examples/helloWorld/src/main/java/org/hipi/examples/HelloWorld.java:53: error: cannot find symbol
FloatImage avg = new FloatImage(1, 1, 3, avgData);
^
symbol: class FloatImage
location: class HelloWorldMapper
/opt/hipi/examples/helloWorld/src/main/java/org/hipi/examples/HelloWorld.java:53: error: cannot find symbol
FloatImage avg = new FloatImage(1, 1, 3, avgData);
^
symbol: class FloatImage
location: class HelloWorldMapper
/opt/hipi/examples/helloWorld/src/main/java/org/hipi/examples/HelloWorld.java:74: error: cannot find symbol
FloatImage avg = new FloatImage(1, 1, 3);
^
symbol: class FloatImage
location: class HelloWorldReducer
/opt/hipi/examples/helloWorld/src/main/java/org/hipi/examples/HelloWorld.java:74: error: cannot find symbol
FloatImage avg = new FloatImage(1, 1, 3);
^
symbol: class FloatImage
location: class HelloWorldReducer
/opt/hipi/examples/helloWorld/src/main/java/org/hipi/examples/HelloWorld.java:78: error: cannot find symbol
for (FloatImage val : values) {
^
symbol: class FloatImage
location: class HelloWorldReducer
/opt/hipi/examples/helloWorld/src/main/java/org/hipi/examples/HelloWorld.java:108: error: cannot find symbol
job.setInputFormatClass(HibInputFormat.class);
^
symbol: class HibInputFormat
location: class HelloWorld
/opt/hipi/examples/helloWorld/src/main/java/org/hipi/examples/HelloWorld.java:115: error: cannot find symbol
job.setMapOutputValueClass(FloatImage.class);
^
symbol: class FloatImage
location: class HelloWorld
17 errors
:examples:helloWorld:compileJava FAILED
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':examples:helloWorld:compileJava'.
BUILD FAILED
Total time: 10.034 secs hduser@ip-172-31-25-72:/opt/hipi/examples/helloWorld$