Whenever I load NetBeans 6.9 (similar errors happened on previous versions also) then I let NetBeans finish scanning my projects and once it\'s done I try to run a profile w
For windows 8
Delete this directory C:\Users\Shubham\AppData\Local\NetBeans\Cache
Before doing so close netbeans.
Start Netbeans again and let it read the project.
Test project. Run project. It should work fine.
I didn't read the complete question, but try: Right click project > properties > run > browse for main class
Else try making a new project and then copy the scr folder from the old one to the new project.
I fixed a very similar behaviour by deleting NetBeans's cache. Delete the folder User\.netbeans\6.9\var\cache\index\.
Windows 7 and Netbeans 7.2: User\AppData\Local\NetBeans\Cache\7.2\index