Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8235990

java.lang.IllegalAccessError using Label()

XMLWordPrintable

    • x86
    • os_x

      ADDITIONAL SYSTEM INFORMATION :
      macOs: 10.14.6 (18G2022)

      A DESCRIPTION OF THE PROBLEM :
      Throws java.lang.IllegalAccessError when attempting to instantiate javafx.scene.control.Label

      REGRESSION : Last worked in version 8

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run attached demo program.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      I expected the code to run. It works under JDK 1.8.
      ACTUAL -
      Throws java.lang.IllegalAccessError when attempting to instantiate javafx.scene.control.Label

      ---------- BEGIN SOURCE ----------
      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.Label;
      import javafx.scene.layout.*;
      import javafx.stage.Stage;
      public class LabelTest extends Application {

        // From: https://www.geeksforgeeks.org/javafx-label/

        public void start(Stage s) {
          s.setTitle("LabelTest");
          Label b = new Label("This is a label");
          StackPane r = new StackPane();
          r.getChildren().add(b);
          Scene sc = new Scene(r, 200, 200);
          s.setScene(sc);
          s.show();
        }

        public static void main(String args[]) {
          launch(args);
        }
      }

      ---------- END SOURCE ----------

      FREQUENCY : always


            kcr Kevin Rushforth
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: