title: Java Error: Could not find or load main Class on Raspberry
body: <p>I'm trying to learn JavaFX in combination with a Raspberry Pi with the OS Raspian (Jessie). 
  Right now I'm coding in IntelliJ IDE with a basic example of JavaFX. 
  My Windows 10 PC is using the newest SDK. 8.0 JDK. The Raspian is using 8.0</p>
  
  <p>When I compile the software on my Windows PC I'm getting a .jar File. I made sure that the <strong>Artifacts</strong> are correct and linked to the main class of the package. The problem what I expecting is when I run the .jar on the Raspberry that I'm getting the following error:</p>
  
  <pre><code>Error: Could not find or load Main class sample.Main
  </code></pre>
  
  <p>The command that I'm executing:</p>
  
  <pre><code>java -jar care.jar
  </code></pre>
  
  <p>I made sure that the JDK is installed correctly. The Java package should be compiled right for Linux. </p>
  
  <p>The code that I'm using is a standard example of IntelliJ. 
  <strong>sample.Main</strong></p>
  
  <pre><code> package sample;
  
          import javafx.application.Application;
          import javafx.fxml.FXMLLoader;
          import javafx.scene.Parent;
          import javafx.scene.Scene;
          import javafx.stage.Stage;
  
  public class Main extends Application {
  
      @Override
      public void start(Stage primaryStage) throws Exception{
          Parent root = FXMLLoader.load(getClass().getResource("sample.fxml"));
          primaryStage.setTitle("Hello World");
          primaryStage.setScene(new Scene(root, 300, 275));
          primaryStage.show();
      }
  
  
      public static void main(String[] args) {
          launch(args);
      }
  }
  </code></pre>
  
  <p><strong>sample.fxml</strong></p>
  
  <pre><code>&lt;?import javafx.geometry.Insets?&gt;
  &lt;?import javafx.scene.layout.GridPane?&gt;
  
  &lt;?import javafx.scene.control.Button?&gt;
  &lt;?import javafx.scene.control.Label?&gt;
  &lt;GridPane fx:controller="sample.Controller"
            xmlns:fx="http://javafx.com/fxml" alignment="center" hgap="10" vgap="10"&gt;
  &lt;/GridPane&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/PAh21.png" rel="nofollow noreferrer">Artifacts settings</a></p>
  
  <p><a href="https://i.stack.imgur.com/gkIQe.png" rel="nofollow noreferrer">Structure tree + IDE overview</a></p>
  
  <p>I tried to add the .class files in the same directory of the .jar file. But with no luck.</p>