I am taking an edX course and for one of the home work assignments, it has me downloading two jar files and testing my code. I was able to successfully run both jar files in Eclipse by adding them to the build path.
However, looking up similar means for Intellij, I cannot get the tests.jar to work and am receiving the below error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/junit/runner/JUnitCore
at Homework1Grader.main(Homework1Grader.java:8)
Caused by: java.lang.ClassNotFoundException: org.junit.runner.JUnitCore
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
... 1 more
I have tried adding the jar files themselves as dependencies or as libraries but neither method seemed to have worked. I included a screenshot of my project structure here. Also to mention, I have both jar files in the project's root directory. I think this might be an issue with the packaging but I am not sure. I assume if a package is not specified, Intellj takes everything in the default package.
I have also included the java files and the jar files I was meant to test it with below.