title: How can I call a Go function from Java using the Java native interface?
body: <p>It is possible to call C methods through the <a href="https://en.wikipedia.org/wiki/Java_Native_Access" rel="nofollow noreferrer">JNA</a> interface in Java. How can I reach the same functionality with Go?</p>
  <pre><code>package main
  
  import &quot;fmt&quot;
  
  import &quot;C&quot;
  
  //export Add
  func Add(x, y int) int {
      fmt.Printf(&quot;Go says: adding %v and %v\n&quot;, x, y)
      return x + y
  }
  </code></pre>