Dear Naik:
I have already set path both for Hadoop and Java in .hadoop and run it prior to
compilation
Export JAVA_HOME=/home/anand_vihar/jdk1.7.0_75Export
HADOOP_INSTALL=/home/anand_vihar/hadoop-2.6.0PATH=:$PATH:$HADOOP_INSTALL/bin:$HADOOP_INSTALL/sbin:$HADOOP_INSTALL/share:$JAVA_HOME
So, is there not a way that the compiler goes thru all folders/jar and pick up
the right class and copile with just
$javac *.java.
If not is there a way to do so, else every time compilation needs to be done
then a complete path list has to be typed and who knows which class is located
in which jar which is needed for compilation, which when not found gives a
compile error which becomes difficult to debug.
Thanks
Regards
Anand Murali 11/7, 'Anand Vihar', Kandasamy St, MylaporeChennai - 600 004,
IndiaPh: (044)- 28474593/ 43526162 (voicemail)
On Monday, April 13, 2015 9:58 PM, Ravindra Kumar Naik
<[email protected]> wrote:
You need to set classpath to hadoop jar
java -classpath <path/to/hadoop-2.6-core.jar>" MaxTemperatureMapper.java
On Mon, Apr 13, 2015 at 11:33 AM, Anand Murali <[email protected]> wrote:
Dear Mr. Ted:
Please find details
Last login: Sun Apr 12 16:33:18 2015 from localhost
anand_vihar@Latitude-E5540:~$ cd hadoop-2.6.0
anand_vihar@Latitude-E5540:~/hadoop-2.6.0$ . .hadoop
anand_vihar@Latitude-E5540:~/hadoop-2.6.0$ cd etc/hadoop
anand_vihar@Latitude-E5540:~/hadoop-2.6.0/etc/hadoop$ sh hadoop-env.sh
anand_vihar@Latitude-E5540:~/hadoop-2.6.0/etc/hadoop$ java -version
java version "1.7.0_75"
Java(TM) SE Runtime Environment (build 1.7.0_75-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.75-b04, mixed mode)
anand_vihar@Latitude-E5540:~/hadoop-2.6.0/etc/hadoop$ hadoop version
Hadoop 2.6.0
Subversion https://git-wip-us.apache.org/repos/asf/hadoop.git -r
e3496499ecb8d220fba99dc5ed4c99c8f9e33bb1
Compiled by jenkins on 2014-11-13T21:10Z
Compiled with protoc 2.5.0
>From source with checksum 18e43357c8f927c0695f1e9522859d6a
This command was run using
/home/anand_vihar/hadoop-2.6.0/share/hadoop/common/hadoop-common-2.6.0.jar
anand_vihar@Latitude-E5540:~/hadoop-2.6.0/etc/hadoop$ cd ..
anand_vihar@Latitude-E5540:~/hadoop-2.6.0/etc$ cd ..
anand_vihar@Latitude-E5540:~/hadoop-2.6.0$ start-dfs.sh --config
/home/anand_vihar/hadoop-2.6.0/conf
Error Messages
$javac MaxTemperatureMapper.java
symbol: class Mapper
MaxTemperatureMapper.java:8: error: cannot find symbol
public class MaxTemperatureMapper extends Mapper<LongWritable, Text, Text,
IntWritable>
^
symbol: class LongWritable
MaxTemperatureMapper.java:8: error: cannot find symbol
public class MaxTemperatureMapper extends Mapper<LongWritable, Text, Text,
IntWritable>
^
symbol: class Text
MaxTemperatureMapper.java:8: error: cannot find symbol
public class MaxTemperatureMapper extends Mapper<LongWritable, Text, Text,
IntWritable>
^
symbol: class Text
MaxTemperatureMapper.java:8: error: cannot find symbol
public class MaxTemperatureMapper extends Mapper<LongWritable, Text, Text,
IntWritable>
^
symbol: class IntWritable
MaxTemperatureMapper.java:15: error: cannot find symbol
public void map(LongWritable key, Text value, Context context)
^
symbol: class LongWritable
location: class MaxTemperatureMapper
MaxTemperatureMapper.java:15: error: cannot find symbol
public void map(LongWritable key, Text value, Context context)
^
symbol: class Text
location: class MaxTemperatureMapper
MaxTemperatureMapper.java:15: error: cannot find symbol
public void map(LongWritable key, Text value, Context context)
^
symbol: class Context
location: class MaxTemperatureMapper
MaxTemperatureMapper.java:25: error: cannot find symbol
airtemperature = Integer.parseInt(line.substring(87,92));
^
symbol: variable airtemperature
location: class MaxTemperatureMapper
MaxTemperatureMapper.java:28: error: cannot find symbol
if (airTemparature != MISSING && quality.matches("[01459]"))
^
symbol: variable airTemparature
location: class MaxTemperatureMapper
MaxTemperatureMapper.java:30: error: cannot find symbol
context.write(new Text(year), new IntWritable(airTemperature));
^
symbol: class Text
location: class MaxTemperatureMapper
MaxTemperatureMapper.java:30: error: cannot find symbol
context.write(new Text(year), new IntWritable(airTemperature));
^
symbol: class IntWritable
location: class MaxTemperatureMapper
MaxTemperatureMapper.java:14: error: method does not override or implement a
method from a supertype
@Override
^
17 errors
Hope someone can advise. Look forward to hearing.
Thanks
Regards
Anand Murali 11/7, 'Anand Vihar', Kandasamy St, MylaporeChennai - 600 004,
IndiaPh: (044)- 28474593/ 43526162 (voicemail)
On Sunday, April 12, 2015 5:59 PM, Ted Yu <[email protected]> wrote:
Can you tell us how you setup your project?
Do you use maven to build it ?
Please pastebin snippet of your code and the error you got.
Cheers
On Apr 12, 2015, at 4:16 AM, Anand Murali <[email protected]> wrote:
Dear All:
I am new to hadoop2.6.0. I managed to set up and install Hadoop and Java 1.7. I
wrote my first hadoop code with import statements of Hadoop class files.
However when I try and compile the code, I get errors, which are reflective of
the class files, which I suppose is not imported. I have run hadoop-env.sh
successfully before dameon startup. Can somebody advise.
Thanks
Anand Murali 11/7, 'Anand Vihar', Kandasamy St, MylaporeChennai - 600 004,
IndiaPh: (044)- 28474593/ 43526162 (voicemail)