0

I have looked through similiar posts about this but none of the already posted solutions have worked for me. Therefore I will try to explain my particular situation and hope that someone knows what I have done wrong.

I am working with IntelliJ and SceneBuilder to build a recipebook for a school project, however, it does not seem to work to compile the project at the moment.

The error message I have been given is:

Error. JavaFX runtime components are missing, and required to run this application

Process finished with exit code 1

What I have done:

I have to my knowledge done everything right by adding all libraries in Project Structure such as javafx 17 library, and also the backend for this particular project. I have also configured my VM-options accordingly:

--module-path \Users\Admin\Skola2\javafx-sdk-17.0.6\lib\ --add-modules=javafx.controls,javafx.fxml

I have also checked whether the JavaFX plugin is active which it is. To my knowledge this should be everything you need to configure in order to know whether the program could compile or not.

My main class:

package recipesearch;


import java.util.ResourceBundle;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
public class RecipeSearch extends Application {
    
    @Override
    public void start(Stage stage) throws Exception {
        
        ResourceBundle bundle = java.util.ResourceBundle.getBundle("recipesearch/resources/RecipeSearch");
        
        Parent root = FXMLLoader.load(getClass().getResource("recipe_search.fxml"), bundle);
        
        Scene scene = new Scene(root, 800, 500);
        
        stage.setTitle(bundle.getString("application.name"));
        stage.setScene(scene);
        stage.show();

    }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        launch(args);
    }
    
}
 

If anyone has any idea on what to do, please help! Thank you.

  • 2
    If you want to make the argument that this is somehow different to any of the dozens (if not hundreds) of similar questions on this site, you need to provide much more detail about what you did. IntelliJ will allow you to create a JavaFX project right out of the box, and it should just run from there with no additional configuration. Other than that, you can follow the instructions in the [documentation](https://openjfx.io/openjfx-docs/). Specify exactly which set of instructions you followed. How are you running the application (via the IDE? from the command line?). – James_D Mar 28 '23 at 16:21
  • 3
    This is a runtime error, not a compile error. Instructions to [create a new JavaFX project in Idea](https://www.jetbrains.com/help/idea/javafx.html). – jewelsea Mar 28 '23 at 16:27
  • @James_D I have no idea if the issue is different from anyone elses, but from what I have tried none of the existing ones have solved my problem. I reached out here to ask more experienced programmers if they know a basic solution to this problem. As I stated in the question, I am not sure if my problem differs from somebody elses, however, I have tried several already posted methods. – Leo Wahlbeck Mar 28 '23 at 16:33

0 Answers0