title: How can I export JUnit test cases into an executable .jar?
body: <p>I am using Selenium and JUnit to automate some testing. I want to be able to export this into a runnable jar file. I was not able to and I am assuming it is because there is no main method, JVM doesn't know what to run....</p>
  
  <p>I saw this post <a href="https://stackoverflow.com/q/4648341/8854270">how to export (JUnit) test suite as executable jar</a> and it suggested adding a main and running the JUnit from there. (I would have commented on that post, but it didn't let me )</p>
  
  <pre><code>public static void main(String[] args) {
      JUnitCore.main("folder.package.testClass");
  }
  </code></pre>
  
  <p>I made a new java class with this main method in it but the test class is never executed (from eclipse). Also if I try to export the project, I get errors and it doesn't export.</p>
  
  <p>For my purposed of exporting all the JUnit classes into 1 Jar file and running from there, what the best way I could do this? I might event build a small menu where the user can pick which test class they want to run (which I'm assuming will require a main method some where....).</p>