Skip to content
Advertisement

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

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 Eclipse window? I get no useful information just a long and useless failure trace (not included here).

I am using JUnit 4.11

I have written the following code – just to see if it works:

JavaScript

Edit: Sorry In Eclipse window it’s called actually a “Failure trace”:

JavaScript

Advertisement

Answer

You’ve probably got one of two problems:

1) You’re using JUnit 4.11, which doesn’t include hamcrest. Add the hamcrest 1.3 library to your classpath.

2) You’ve got hamcrest 1.3 on your classpath, but you’ve got another version of either junit or hamcrest on your classpath.

For background, junit pre 4.11 included a cut down version of hamcrest 1.1. 4.11 removed these classes.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement