title: How to Fix NoClassDefFoundError in JavaFX?
body: <p>I'm trying to build a small user interface using JavaFX, But I'm getting an error like this: </p>
  
  <blockquote>
    <p>Error: Could not find or load main class myApp Caused by:
    java.lang.NoClassDefFoundError: javafx/application/Application</p>
  </blockquote>
  
  <p>This is my code:
  and im using jdk 12.0.2</p>
  
  <pre><code>import javafx.application.Application;
  import javafx.scene.Group;
  import javafx.scene.Scene;
  import javafx.scene.paint.Color;
  import javafx.stage.Stage;
  
  public class myApp extends Application{
  public static void main(String[] args) {
      Phonebook mybook = new Phonebook();
      launch(args);
  
  
  }
  @Override
  public void start(Stage primaryStage) throws Exception {
      Group group = new Group();
      Scene scene = new Scene(group, 600, 300);
      scene.setFill(Color.GRAY);
      primaryStage.setTitle("Phone Book");
      primaryStage.setScene(scene);
      primaryStage.show();
  
  }
  </code></pre>
  
  <p>This is the Libraries and jdk I'm using:
  <a href="https://i.stack.imgur.com/C7bRu.png" rel="nofollow noreferrer">Image1</a></p>