Eclipse JUnit - possible causes of seeing “initializationError” in Eclipse window

后端 未结 25 1324
情深已故
情深已故 2020-12-13 12:35

I know this question is pretty general but I haven\'t found any hints on why this error may show up. What are possible causes of seeing initalizationError in Eclips

25条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-13 12:55

    I had the same issue... I was using maven building tool with JUnit dependency scope as 'test' and my @Test method was in main module.

    To resolve, I've: 1. Commented the scope tag of JUnit dependency in the pom.xml 2. Rebuilt the package 3. Made sure the Test class has only one constructor

    The issue can be two-folded: 1. The JUnit dependency is limited to test scope and the @Test method is in main scope 2. The test class has more than one constructor

提交回复
热议问题