java.lang.NoClassDefFoundError in junit January 25, 2023 by Tarik Right click your project in Package Explorer > click Properties go to Java Build Path > Libraries tab click on ‘Add Library’ button select JUnit click Next. select in dropdown button JUnit4 or other new versions. click finish. Then Ok.