Reputation: 1202
Before my question is closed as a duplicate: I have looked at all other related questions but the solutions provided don't work for me, probably because I'm using Cygwin, not Unix.
I'm trying out the tuturial here. Whenever I run the command (while in c:/hadoop) bin/hadoop com.sun.tools.javac.Main WordCount.java
, I get the error Could not find or load main class com.sun.tools.javac.Main
.
My Java_Home
variable is set to: c:/PROGRA~1/Java/jdk1.7.0_17
(echo $JAVA_HOME
confirms this), and my HADOOP_CLASSPATH
to c:/PROGRA~1/Java/jdk1.7.0_17/lib/tools.jar
.
javac -version
confirms that I'm using jdk1.7.0_17.
Would anyone know what could be the issue?
Upvotes: 0
Views: 1381
Reputation: 34618
One of the differences between Windows and Unix/Linux tools is the handling of PATH
and CLASSPATH
variables, where in Windows, to support the C:\...
path notation, the delimiter in PATH
and CLASSPATH
is a semicolon ;
, and on Linux, where :
in file paths is very rare, the delimiter is :
.
As you are running on cygwin, you are using the Unix/Linux version of Hadoop (and probably Java as well). This means it is probably expecting CLASSPATH
to be colon (:
) delimited.
So you should use the "Unix" version of the path you have given, which in cygwin is available by replacing the c:
with /cygdrive/c
.
Upvotes: 1