title: How to resolve incubator module jdk.incubator.vector when running Java application
body: <p>I am attempting to test the new Vector API introduced as an incubator module in JDK 16. For this, I have the following class:</p>
  <pre class="lang-java prettyprint-override"><code>import jdk.incubator.vector.FloatVector;
  import jdk.incubator.vector.VectorSpecies;
  
  public class Main {
  
      static final VectorSpecies&lt;Float&gt; SPECIES = FloatVector.SPECIES_256;
  
      static void vectorComputation(float[] a, float[] b, float[] c) {
  
          for (int i = 0; i &lt; a.length; i += SPECIES.length()) {
              var m = SPECIES.indexInRange(i, a.length);
  
              var va = FloatVector.fromArray(SPECIES, a, i, m);
              var vb = FloatVector.fromArray(SPECIES, b, i, m);
              var vc = va.mul(va).
                      add(vb.mul(vb)).
                      neg();
              vc.intoArray(c, i, m);
          }
      }
  
      public static void main(String[] args) {
          float[] a = new float[]{1.0f, 3.0f, 2.0f};
          float[] b = {1.0f, -1.0f, 5.0f};
          float[] c = {1.0f, 6.0f, 1.0f};
          Main.vectorComputation(a, b, c);
          System.out.println(c);
      }
  }
  
  </code></pre>
  <p>I was able to compile this with the following command:</p>
  <pre><code>javac Main.java --add-modules jdk.incubator.vector
  </code></pre>
  <p>However, when I try to run this I get the following error.</p>
  <pre><code>java Main --add-modules jdk.incubator.vector
  Error: Unable to initialize main class Main
  Caused by: java.lang.NoClassDefFoundError: jdk/incubator/vector/Vector
  </code></pre>
  <p>How would I go about resolving this class?</p>