title: Why does my program throw this JNI error?
body: <p>So I have written a little JavaFX program that creates a local http server, receives pixel color input, and throws it all into a single image that can be saved. </p>
  
  <p>The Problem: Whenever I try to run the program on a different computer I receive this error:</p>
  
  <p><a href="https://i.stack.imgur.com/homZf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/homZf.png" alt="enter image description here"></a></p>
  
  <p>However if the program is compiled on the "different computer" then the error is fixed and the program works as normal. Having each new user download the JDK is and compiling the program theirselves is impractical so I am hoping to resolve this on my end.</p>
  
  <p>I have condensed the code to where I think the problem is, the rest is only boring JavaFX pane's and the what not. </p>
  
  <pre><code>import com.sun.net.httpserver.*;
  import java.io.*;
  import java.net.InetSocketAddress;
  import java.awt.image.BufferedImage;
  import javafx.embed.swing.SwingFXUtils;
  import javax.imageio.ImageIO;
  import java.util.*;
  
  public void handle(HttpExchange exchanger) throws IOException{
              String response = "Request Recieved";
              exchanger.sendResponseHeaders(200,response.length());
              InputStream input = Exchanger.getRequestBody();
              String value = convertStreamToString(input);
              input.close();
              OutputStream output = exchanger.getResponseBody();
              output.write(response.getBytes());
              output.close();
              if (xTotal == 0 &amp;&amp; yTotal == 0 &amp;&amp; activated){
                      Scanner scan = new Scanner(value);
                      xTotal = scan.nextInt();
                      yTotal = scan.nextInt();
                      image = new WritableImage(xTotal,yTotal);
                      pixelWrite = image.getPixelWriter();
              }
              else{
                  if (value.equals("StreamComplete")){
                      ExportImage.setDisable(false);
                  }
                  else{
                      int[][] tempArray = parseData(value);
                      if (tempArray.length &gt; xTotal){
                          yCount++;
                          for (int i = 0; i &lt; xTotal ; i++){
                              pixelWrite.setColor(i,yCount, Color.rgb(tempArray[i][0],tempArray[i][1],tempArray[i][2],1));
                          }
                          yCount++;
                          for (int i = xTotal; i &lt; xTotal*2; i++){
                              pixelWrite.setColor(i-xTotal,yCount, Color.rgb(tempArray[i][0],tempArray[i][1],tempArray[i][2],1));
                          }
  
                      }
                      else{
                          yCount++;
                          for (int i = 0; i &lt; xTotal ; i++){
                              pixelWrite.setColor(i,yCount, Color.rgb(tempArray[i][0],tempArray[i][1],tempArray[i][2],1));
                          }
                      }
                  }
              }
  </code></pre>
  
  <p>Anyways I appreciate any help you guys can offer. </p>
  
  <p>Thanks</p>