1

This is the image error!

I checked out many sources on how to fix this problem! I am using Java 15, and I have the RichTextFX jar file version 0.10.6 installed. I am getting this error but I do not know why, as according to documentations I am doing everything correctly. JavaFX also works fine for me, I have javafx 16 installed. This is my code:

CodeArea codeArea = new CodeArea();
@Override
public void start(Stage stage) throws Exception {
    // TODO Auto-generated method stub
    
    MenuBar menuBar = new MenuBar();
    Menu menu1 = new Menu("File");
    Menu menu2 = new Menu("Edit");
    Menu menu3 = new Menu("Project");
    Menu menu4 = new Menu("Window");
    Menu menu5 = new Menu("Help");
    
    menuBar.getMenus().add(menu1);
    menuBar.getMenus().add(menu2);
    menuBar.getMenus().add(menu3);
    menuBar.getMenus().add(menu4);
    menuBar.getMenus().add(menu5);
    
    BorderPane borderPane = new BorderPane();
    HBox statusbar = new HBox();
    TabPane tabPane = new TabPane();
    
    
    codeArea.setParagraphGraphicFactory(LineNumberFactory.get(codeArea));
    
    Tab tab1 = new Tab("Untitled", codeArea);
    tabPane.getTabs().add(tab1);
    borderPane.setTop(menuBar);
    borderPane.setCenter(tabPane);
    borderPane.setBottom(statusbar);
    
    Scene scene = new Scene(borderPane);
    stage.setScene(scene);
    stage.setMaximized(true);
    stage.setTitle("Gooye");
    stage.show();
    
    
}
  • Please post the full error in the question. – Slaw Mar 20 '21 at 21:31
  • @Slaw That is the full error: `Missing JavaFX application class TextEditor` – Benjamin Sloutsky Mar 20 '21 at 21:48
  • worksforme - there's something wrong in your project setup. What I did (in a modular project): downloaded the fat jar, renamed to richtextfx.jar (just to get rid of the version), added the jar to the module path, added the requires to module.info. – kleopatra Mar 21 '21 at 12:05
  • I replaced the 0.10.6 jar with the fat jar file and these are the errors I receive `Exception in Application start method java.lang.reflect.Invocation TargetExceptionCaused by: java.lang.RuntimeException: Exception in Application start method Caused by: java.lang.IllegalAccessError: class org.fxmisc.richtext.TextFlowExt (in unnamed module @0x31299b) cannot access class com.sun.javafx.text.PrismTextLayout (in module javafx.graphics) because module javafx.graphics does not export com.sun.javafx.text to unnamed module @0x31299b` – Benjamin Sloutsky Mar 21 '21 at 19:03

0 Answers0