Failing to run JUnit Test in Intellij

Am trying to run JUnit test in Intellij but it pops up exception with error message java: package org.junit does not exist. Have tried to import junit-4.12.jar library into my java class path but the same exception persists. Assistance needed!

Try looking through this if it can be of help.

1 Like

Thanks @lgilbert for the link though this helped me fix the error with ease

1 Like

you could also write up the fix you made to help others here.

1 Like

After Importing Junit jar file from the directory C:\Program Files\IntelliJ IDEA 2018.1.2\lib\junit-4.12jar. Then you need to have test folder not as a sub-folder of src source root but in a separate directory marked as a test source root. Then the Test compile scope will work. Here is the full guide.
cc: @herbert24

1 Like