When creating a Java project, or importing an existing Java project, that uses JUnit tests in Eclipse, you may run into the error message:
the import org.junit cannot be resolved
The error results when properly attempting to import JUnit with lines like the following:
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
The error occurs because the JUnit library has not been configured for the project, but can be resolved using the following steps.
1. Right click on the Java project and select Build Path > Configure Build Path.
2. Click Add Library.
3. Select JUnit, then click Next.
4. Now select the latest version of the JUnit library, then click Finish.
The error should now be resolved.
Thanks Lahman, Its worked.
thank u very much, it worked
Thanks its worked!!!
Thanks, super helpful
This is really helpful. Thanks !!!
very thankful
Thanks a million!!!!
Thanks a lot
Thank you!
Thank you
Thanks it helpded!
Thanks a bunch!
Thanks ..that really helped!
thank you! it helped me sooo much!!
Hi Todd Lahman, when I follow your instructions I still could not solve the problem until I found out that I have to import the cucumber-junit.1.0.2.jar (in my case the system needs 1.0.2 version) files by myself. So before I do that I download the .jar file on https://mvnrepository.com/artifact/info.cukes/cucumber-junit/1.0.2
After that go to Eclipse on Menu Project > Properties > Java Build Path > Libraries > Add External JARs > add the .jar files you have downloaded > Apply and Close.
After doing that I got my problem solved.
Maybe it can help someone who has the same problem with me :D
Thank you! It really helps me!
Thank you!
Thanks!