title: How to make acces to src.test package from main class in Java or how to run test class from main class?
body: <p>I try to launch <code>selenium</code> test from main class and try to follow the example from next question: <a href="https://stackoverflow.com/questions/2543912/how-do-i-run-junit-tests-from-inside-my-java-application">How do I run JUnit tests from inside my java application?</a> :</p>
  
  <pre><code>JUnitCore junit = new JUnitCore();
  Result result = junit.run(testClasses);
  </code></pre>
  
  <p>But I cannot use this resolve because I have not access to my test class from main class:</p>
  
  <p><a href="https://i.stack.imgur.com/25E0g.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/25E0g.png" alt="enter image description here"></a></p>
  
  <hr>
  
  <p><strong>Queation:</strong> How to correctly run test class from main class?</p>
  
  <hr>
  
  <p><strong>PS</strong></p>
  
  <p>I need to run test class from main class since is necessary build executable <code>jar</code> file and launched the <code>selenium</code> test from it.</p>