When trying to run a test as a TestNG suite, I would get a very cryptic error message saying that TestNG can't launch because it references a non-existant project. I think my project does exist, I see it in the package explorer!
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- Illegal to have multiple roots (start tag in epilo
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
It doesn't have to be a Java Project, it could be a Maven one as well. There could be a reference problem with the oldest version of the project. Please try deleting the oldest version from your Eclipse workspace, and then change your reference point.
I know this is an old post, but I hit this recently when I moved to using a MacBook Pro.
When I created a new Eclipse workspace and loaded all of my projects from the SCM, I got these Ant failures due to referencing an non-existing project.
The solution was not easy to discover, but the solution is simple: Change your Ant run configuration's JRE to run in the same JRE as the workspace.
You DO NOT need to change your build projects to Java projects.
If its an existing project, you must have classpath and project file in project root folder to make it java project.
Sample:
In my case the run shortcut was referencing an old project.
Simply right clicking on the folder of the project I was trying to run and selecting my java class fixed the problem.
After that pressing the run button started working again.
This issue will manifest for you if you have a test class in a current project that you are trying to run that matches a test class from the project that you either closed or deleted and had previously run unit tests against.
Chances are you have a test case from this deleted / missing or closed project. Eclipse will hide the launch configurations of deleted and closed projects but still attempts to use them when you do the 'right click on class' -> 'run-as' way to invoke a unit test.
The solution here is to unhide the problem launch configuration so you can delete it or modify it to conform to the current project.
Unhide the launch configurations of deleted and closed projects:
This is done via the dropdown menu path -> Eclipse -> Preferences -> "Run/Debug" -> Launching -> "Launch Configurations" In the "Launch Configurations" screen find the "launch configuration filters" section and uncheck the top 2 checkboxes: - "Filter configurations in closed projects" - "Filter configurations in deleted or missing projects" click the "Apply and close" button and close the popup screen.
Edit / delete the problem configuration:
open the Run -> "Run configurations" from the dropdown menu. On the left find and select the (no longer hidden) run configuration. In this configuration you can either update the project references to the current project or you can delete the configuration altogether. If you delete the run configuration eclipse will create a new one from scratch with the correct project settings when you attempt to "run as" on the current class.
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.