I wasted like 3 hours on this. It has been due to some sort of java directory issues or what. Anyways this is how i did it.
Open command line. Go to the exact folder where .java class is located. go there and execute command
javac HelloWorld.java
then go back to the folder containing the complete package. There type this statement for generating the header file from the class file. The directory must be like in my case the whole package was in Java directory file so i went back there and typed the following command.
javah -jni com.example.aliabbasjaffri.temporary.HelloWorld
Voila, Header file at your service.