When I try to compile my program in Hadoop with this command

```none
bin/hadoop com.sun.tools.javac.Main WordCounter.java

```

from Hadoop folder, it says

```none
Error: Could not find or load main class com.sun.tools.javac.Main

```

I looked in similar threads where people suggested to check if `JAVA_HOME` is properly stated. So in `etc/hadoop/hadoop-env.sh`I added this line

```none
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64

```

then checked if `tools.pack` is properly unpacked in `/usr/lib/jvm/java-7-openjdk-amd64/lib` and it was. Then I tried `javac -version` which gave 

```none
javac 1.7.0_65

```

I tried to reinstall Java but it didn't solve the problem.