title: java.net.SocketException: Protocol not supported
body: <p>I am trying to create a SCTP application.
  I wrote a sample code to test if SCTP is supported on Ubuntu 14.04 with libsctp-dev installed.</p>
  
  <pre><code>    public class TestSctp {
  
      public static void main(String[] args){
          try {
              com.sun.nio.sctp.SctpChannel sc = com.sun.nio.sctp.SctpChannel.open();
              System.out.println("SCTP supported");
          } catch (Exception ex) {
              ex.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <p>And this is the error I get:</p>
  
  <pre><code>java.net.SocketException: Protocol not supported
  at sun.nio.ch.sctp.SctpNet.socket0(Native Method)
  at sun.nio.ch.sctp.SctpNet.socket(SctpNet.java:85)
  at sun.nio.ch.sctp.SctpChannelImpl.&lt;init&gt;(SctpChannelImpl.java:138)
  at com.sun.nio.sctp.SctpChannel.open(SctpChannel.java:166)
  at TestSctp.main(TestSctp.java:7)
  </code></pre>
  
  <p>This is my java version:</p>
  
  <p><code>java version "1.8.0_71"
  Java(TM) SE Runtime Environment (build 1.8.0_71-b15)
  Java HotSpot(TM) 64-Bit Server VM (build 25.71-b15, mixed mode)</code></p>
  
  <p>I am unable to fix this exception.</p>