The solution to this problem is very simple...
If you don't have Ant build file then generate it. In Eclipse you can easily create a Ant file.
Refer to the link to create Ant build file [http://www.codejava.net/ides/eclipse/how-to-create-ant-build-file-for-existing-java-project-in-eclipse].
Now follow the given steps:
1) Add your Ant build file in Ant view that is in view window.
2) right click on your Ant build file and select Run As and the second option in that "Ant Build".
3) Now a dialog box will open with various options and tabs.
4) Select the JRE tab.
5) You will see three radio buttons and they will be having JRE or JDK selected as an option.
6) Look carefully if the radio button options are having JRE as selected then change it to JDK.
7) Click apply.
That's it...!!!