Java inner class not found although present in the same directory

I'm new to Hadoop and I'm trying to run a basic MapReduce program. I created a java file in my home folder class

I executed using hadoop command. The class files for outer and inner classes were created.

Then I created a jar file using jar cf wc.jar WordCountHdp1.class command which created the necessary jar file.

But when I ran the hadoop jar wc.jar WordCount data1.txt out1 command, I get the following exception:

Exception in thread "main" java.lang.NoClassDefFoundError: WordCountHdp1$Map
        at WordCountHdp1.main(
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(
        at java.lang.reflect.Method.invoke(
        at org.apache.hadoop.util.RunJar.main(
Caused by: java.lang.ClassNotFoundException: WordCountHdp1$Map
        at Method)
        at java.lang.ClassLoader.loadClass(
        at java.lang.ClassLoader.loadClass(
        ... 7 more

This happens although I have the necessary inner classes class files in the same directory. Help.