Could not find or load main class error

374 views
Skip to first unread message

chadalavada trinesh

unread,
Jun 17, 2014, 1:11:36 AM6/17/14
to hadoop-learner-tutori...@googlegroups.com
Hi Nitesh,

           I am using Windows 8. I tried installing Hadoop using Cygwin. I configured ssh. When i am trying to run ./hadoop version command, i am getting the following error "Error: Could not find or load main class org.apache.hadoop.util.VersionInfo". I searched in Google for this error i found that there is a problem with classpath. I tried different solutions given by people but still couldn't solve the problem. Can you please tell me why i am getting that error and help me solve it. I am stuck with that issue from a period of time.

           If i execute ./hadoop classpath i am getting the following output: 

trinesh@TRINESH-PC /cygdrive/c/hadoop/bin
$ ./hadoop classpath
cygpath -wp "$CLASSPATH":/cygdrive/c/hadoop/share/hadoop/hdfs:/cygdrive/c/hadoop/share/hadoop/hdfs/lib/*:/cygdrive/c/hadoop/share/hadoop/hdfs/*:/cygdrive/c/hadoop/share/hadoop/yarn/lib/*:/cygdrive/c/hadoop/share/hadoop/yarn/*:/cygdrive/c/hadoop/share/hadoop/mapreduce/lib/*:/cygdrive/c/hadoop/share/hadoop/mapreduce/*:/contrib/capacity-scheduler/*.jar

          Please help me in solving this error.



Thanks and Regards,
Trinesh.

Nitesh Jain

unread,
Jun 17, 2014, 1:48:16 AM6/17/14
to hadoop-learner-tutori...@googlegroups.com
Hi Trinesh,

By the look of it, it looks like hadoop script is not in the path. For that, hadoop/bin should have been in the active path, which I cannot see in your classpath. If you go in hadoop/bin folder, you would see all the script ( even hadoop script) which is executed when you type in the command. Here,  OS is not able to find the script in the active path and so throwing an error.

Could you please but hadoop/bin folder in the active path and see if typing the command: hadoop -version 

Or you can try one more thing. You can manually go in hadoop/bin folder and try the command: hadoop -version    and probably it should work.

Please let me know if this solves the problem.

Best,
Nitesh

chadalavada trinesh

unread,
Jun 17, 2014, 3:09:51 AM6/17/14
to hadoop-learner-tutori...@googlegroups.com
Hi Nitesh,

       As you told, i already had /hadoop/bin in PATH variable. i even added HADOOP_CLASSPATH in the environmental variables- both didn't worked. i also tried adding classpath using this command  
$ export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:cygdrive/c/hadoop/bin/*
. Can i know is it correct?  
 
       I attached the error snapshot. Can you please check that and tell me where i am going wrong. 

Thanks and Regards,
Trinesh
Error.jpg

Nitesh Jain

unread,
Jun 17, 2014, 3:51:26 AM6/17/14
to hadoop-learner-tutori...@googlegroups.com
Hey Trinesh,

Unfortunately, I am not able to recreate it at my end as my cygwin is not setup and hence would not be able to help you with this. I would highly recommend to go through the course "Setting up Hadoop 2 Made Easy" which would make the task of installation as simple as copy and paste for you. 

I have used cygwin earlier and I can tell you that it gets messy with it with ssh and all these things. Moreover, it doesn't reflect the most probable industry working environment. Please go through my course on Hadoop installation and it should be very simple for you.

Do let me know how can I help you more. 

Best,
Nitesh
Reply all
Reply to author
Forward
0 new messages