title: How to launch JUnit 5 (Platform) from the command line (without Maven/Gradle)?
body: <p>I'd like to run a class containing JUnit 5 tests from the command line. Unfortunately, I have some outside dependencies that prevent me from using Maven, Gradle, or other build systems.</p>
  
  <p>In JUnit 4, I could accomplish this like</p>
  
  <pre><code>java .:"lib/*" org.junit.runner.JUnitCore TestClass
  </code></pre>
  
  <p>Is there an equivalent for JUnit 5? I'd simply like to know if test succeeded similar to when it runs in IntelliJ.</p>
  
  <p><strong><code>TestClass.java</code></strong></p>
  
  <pre><code>import org.junit.jupiter.api.AfterEach;
  import org.junit.jupiter.api.BeforeAll;
  import org.junit.jupiter.api.BeforeEach;
  import org.junit.jupiter.api.Test;
  
  import java.util.ArrayList;
  import java.util.Collections;
  
  import static org.junit.jupiter.api.Assertions.*;
  
  public class TestClass {
  
      private static ArrayList&lt;Student&gt; students;
      private static ArrayList&lt;Student&gt; inAgeOrderStudents;
      private static ArrayList&lt;Student&gt; inNameOrderStudents;
  
      @BeforeAll
      static void setUp(){
          initializeStudents();
          initSortedAgeStudents();
          initSortedNameStudents();
      }
  
      @BeforeEach
      void reloadStudents() {
          Collections.shuffle(students);
      }
  
     static void initializeStudents(){
          students = new ArrayList&lt;Student&gt;();
  
          students.add(new Student(18, "Tim"));
          students.add(new Student(18, "Tim"));
          students.add(new Student(16, "Jean"));
          students.add(new Student(14, "Lin"));
          students.add(new Student(19, "Sam"));
      }
  
      static void initSortedAgeStudents(){
          inAgeOrderStudents = new ArrayList&lt;Student&gt;();
          inAgeOrderStudents.add(new Student(14, "Lin"));
          inAgeOrderStudents.add(new Student(16, "Jean"));
          inAgeOrderStudents.add(new Student(18, "Tim"));
          inAgeOrderStudents.add(new Student(18, "Tim"));
          inAgeOrderStudents.add(new Student(19, "Sam"));
      }
  
      static void initSortedNameStudents(){
          inNameOrderStudents = new ArrayList&lt;Student&gt;();
          inNameOrderStudents.add(new Student(16, "Jean"));
          inNameOrderStudents.add(new Student(14, "Lin"));
          inNameOrderStudents.add(new Student(19, "Sam"));
          inNameOrderStudents.add(new Student(18, "Tim"));
          inNameOrderStudents.add(new Student(18, "Tim"));
      }
  
  
  
      @Test
      void testMergeSort() {
          assertNotEquals(students, inAgeOrderStudents);
          StudentSortSearch.mergesort(students,StudentSortSearch.SortSearchCriteria.AGE);
          assertEquals(14,students.get(0).getAge());
          assertEquals(19,students.get(4).getAge());
          assertEquals(students, inAgeOrderStudents);
  
          assertEquals(true,students.equals(inAgeOrderStudents));
      }
  
      @Test
      void testQuickSort() {
          StudentSortSearch.quickSort(students,StudentSortSearch.SortSearchCriteria.NAME);
          assertEquals("Jean",students.get(0).getName());
          assertEquals("Tim",students.get(4).getName());
  
          assertEquals(students, inNameOrderStudents);
      }
  
      @Test
      void testBinarySearch() {
          StudentSortSearch searcher = new StudentSortSearch();
          ArrayList&lt;Student&gt; searchResults = searcher.binarySearch(students, 18);
          assertEquals(2, searchResults.size());
          assertEquals(18,searchResults.get(1).getAge());
          assertEquals(18,searchResults.get(0).getAge());
  
          searchResults = searcher.binarySearch(students, "Lin");
          assertEquals(1, searchResults.size());
          assertEquals(14,searchResults.get(0).getAge());
      }
  }
  </code></pre>