[原] eclipse 無法找到 run as junit

雨知發表於2013-06-19

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

問題根源和解決方式

第一,保證有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

 

折磨半天,特此記錄。

相關文章