JUNIT Test class in Eclipse - java.lang.ClassNotFoundException

后端 未结 26 1940
栀梦
栀梦 2020-12-14 13:55

I\'m trying to run my junit test (to verify that a properties file loads correctly) but I get ClassNotFoundException although the class is there and all requir

26条回答
  •  时光取名叫无心
    2020-12-14 14:30

    I add this answer as my solution review from the above.

    1. You simply edit the file .project in the main project folder. Use a proper XML Editor otherwise you will get a fatal error from Eclipse that stats you can not open this project.
    2. I made my project nature Javaby adding this org.eclipse.jdt.core.javanature to .
    3. I then added those lines correctly indented org.eclipse.jdt.core.javabuilder to .
    4. Run as JUnit ... Success

提交回复
热议问题