Eclipse -- Testng references non-existing project XXX, launch configuration

It turns out you just have to make sure your project is a Java Project, and not a Simple project. Check that the navigator shows a little blue 'J' associated with the folder. If not, then you have created a Simple project.

"It would appear that the project you created is not Java project.

Eclipse auto-builds the .java file to .class files for all .java files contained in a Java project.

To create a Java project File>New>Project>Java Project Give the project a name. Click Finish"

Found this answer hidden deep in this source.

In eclipse you should be using Navigator and not Package explorer, as navigator is browsing the actual filesystem, where package explorer is loading certain things only. In the future hopefully people can find the solution more easily.


I have faced the same problem while I was working with raspbian OS for raspberry pi. The problem was the java project was referencing to one of my previous project.

I resolved this problem by doing following steps.

  1. Go to Project->properties
  2. In properties window's left pane select "Run/Debug Settings".
  3. Select "Configure" and click "edit"
  4. In tab "Main" replace Project to your current project.
  5. Select "Main class" by clicking on search button(it will be your class name).
  6. Now hit OK.