Exception in thread “main” java.lang.NoClassDefFoundError: start-all/sh Error

When trying to start hadoop, this error message is quite common :

Exception in thread “main” java.lang.NoClassDefFoundError: start-all/sh

Caused by: java.lang.ClassNotFoundException: start-all.sh
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: start-all.sh. Program will exit.

Here’s a quick check list to resolve this issue:

  1. Ensure you are calling the ‘start-all.sh‘ from within ‘bin‘. If you are inside ‘bin’ then the call should be ‘./start-all.sh‘ and if you are a level above bin, then try running: ‘bin/start-all.sh‘.
  2. One other common mistake I’ve seen is, people try running : ‘bin/hadoop start-all.sh‘. Please do not prefix ‘hadoop‘ to the start call.