[原] eclipse 無法找到 run as junit


碰見這個問題,折磨我好一下!

問題根源和解決方式

第一,保證有junit jar包,基本不會犯這錯誤;

第二,保證你這個類是Source可編譯文件,要是這個類在普通文件夾下,工程是不會編譯它的,也就找不到這個類。

保證這兩點基本就可以執行了。

如何保證第二點:

第一,保證這個類或這目錄,不在這個Excluded下。我碰到情況就是這種情況,不知道什么時候加進去的,Excluded的文件不會被編譯。

image

第二,網上給的一種方式,但也必須是在第一點情況的前提下。

If you are getting the above error message in Eclipse IDE, while running your test case, just make sure that you have the test class as a part of the “eclipse source folder” definition. Easiest way. Right click on the folder –> Build Path –>Use as source folder Done.

可能遇到的錯誤提示

No tests found with test runner JUnit4

The input type of the launch configuration does not exist

 

折磨半天,特此記錄。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM