0

Before I updated BlueJ this program worked fine, but now that I have updated to version 5.1.0 the program doesn't work and shows the above error message. If you need more info on the error message I can send the full list.

import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.Group;
import javafx.scene.shape.Line;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.scene.input.MouseEvent;
import javafx.stage.Stage;

public class Source extends Application{
    public static Group MainGroup = new Group();
    public static Scene MainScene = new Scene(MainGroup);
    @Override public void start(Stage stage){
        stage.setScene(MainScene);
        stage.setFullScreen(true);
        
        stage.show();
    }
}```

Here is the full warning:

Jun 14, 2023 12:01:05 PM com.sun.javafx.application.PlatformImpl startup
WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @c6018c6'
Exception in Application constructor
Exception in thread "JavaFX BlueJ Helper" java.lang.RuntimeException: Unable to construct Application instance: class Source
    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:891)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:196)
    at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class Source
Dragger123
  • 23
  • 5
  • 2
    That's not an error message. – James_D Jun 14 '23 at 19:52
  • 2
    As noted, that's a _warning_, not an _error;_ it won't prevent a JavaFX application from running. See [this Q&A](https://stackoverflow.com/q/67854139/6395627). If your application is failing to start, then please [edit] the question to provide a [mre] and the stack trace of the _error_. Otherwise, your question is a duplicate of the previously linked one. – Slaw Jun 15 '23 at 02:11
  • I added the full warning. – Dragger123 Jun 15 '23 at 17:46
  • Is that the complete stack trace? It looks truncated. – James_D Jun 15 '23 at 18:53
  • Please make sure your example is a [mre] that demonstrates the error. And provide the **full** stack trace (you seem to have truncated the stack trace) of the error emitted by that example. That said, I've heard BlueJ does its own special thing to launch Java/JavaFX applications (different from IDEs like IntelliJ or Eclipse, or build tools like Maven or Gradle), and this "JavaFX BlueJ Helper" thread that the error mentions seems to confirm that. Try making the fields non-static (they shouldn't be static just on principle anyway), or making them local variables, to see if that helps. – Slaw Jun 18 '23 at 01:56

0 Answers0