title: HTTP/2 Java 8, Jetty and ALPN
body: <p>I went thru this page: <a href="https://www.eclipse.org/jetty/documentation/9.3.x/alpn-chapter.html" rel="nofollow">https://www.eclipse.org/jetty/documentation/9.3.x/alpn-chapter.html</a> to have an ALPN boot jar in my classpath and still I can't get it working.</p>
  
  <p>I am confused as to know if I need an Open SDK Java 8 than Oracle Java 8.</p>
  
  <p>My Java version is:</p>
  
  <pre><code>java -version
  java version "1.8.0_11"
  Java(TM) SE Runtime Environment (build 1.8.0_11-b12)
  Java HotSpot(TM) 64-Bit Server VM (build 25.11-b03, mixed mode)
  </code></pre>
  
  <p>And I'm using the following versions of Jetty and ALPN boot:</p>
  
  <pre><code>&lt;jetty-version&gt;9.4.0.M1&lt;/jetty-version&gt;
  &lt;alpn-version&gt;8.1.9.v20160720&lt;/alpn-version&gt;    
  &lt;dependency&gt;
          &lt;groupId&gt;org.mortbay.jetty.alpn&lt;/groupId&gt;
          &lt;artifactId&gt;alpn-boot&lt;/artifactId&gt;
          &lt;version&gt;${alpn-version}&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
      &lt;artifactId&gt;jetty-client&lt;/artifactId&gt;
      &lt;version&gt;${jetty-version}&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.eclipse.jetty.http2&lt;/groupId&gt;
      &lt;artifactId&gt;http2-client&lt;/artifactId&gt;
      &lt;version&gt;${jetty-version}&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.eclipse.jetty.http2&lt;/groupId&gt;
      &lt;artifactId&gt;http2-http-client-transport&lt;/artifactId&gt;
      &lt;version&gt;${jetty-version}&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.eclipse.jetty.http2&lt;/groupId&gt;
      &lt;artifactId&gt;http2-common&lt;/artifactId&gt;
      &lt;version&gt;${jetty-version}&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.eclipse.jetty.http2&lt;/groupId&gt;
      &lt;artifactId&gt;http2-hpack&lt;/artifactId&gt;
      &lt;version&gt;${jetty-version}&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>Also I tried using different versions of Jetty and ALPN which I found here <a href="https://mvnrepository.com/artifact/org.mortbay.jetty.alpn/alpn-boot" rel="nofollow">https://mvnrepository.com/artifact/org.mortbay.jetty.alpn/alpn-boot</a> and here <a href="https://mvnrepository.com/search?q=org.eclipse.jetty" rel="nofollow">https://mvnrepository.com/search?q=org.eclipse.jetty</a></p>
  
  <p>Whichever ways I tried I never got it working submitting a POST request to an HTTP/2 endpoint.</p>
  
  <p>However with Netty and the following dependency my tests were successful:</p>
  
  <pre><code>&lt;dependency&gt;
             &lt;groupId&gt;io.netty&lt;/groupId&gt;
             &lt;artifactId&gt;netty-tcnative-boringssl-static&lt;/artifactId&gt;
             &lt;version&gt;1.1.33.Fork22&lt;/version&gt;
         &lt;/dependency&gt;
  </code></pre>
  
  <p>Where do I find the documentation to see which version of ALPN boot is compatible with Oracle JDK?
  Is ALPN boot only compatible with OpenJDK?</p>
  
  <p>I read that starting Java 9 support for ALPN will be native. </p>
  
  <p>On a side note, which one is better? Netty or Jetty for HTTP/2 calls.</p>