Module not found: javafx.controls












0















I have downloaded JavaFX SDK, unpacked it and set a PATH_TO_FX system variable, following this instructions. I used following code example:



import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;

public class HelloFX extends Application {

@Override
public void start(Stage stage) {
String javaVersion = System.getProperty("java.version");
String javafxVersion = System.getProperty("javafx.version");
Label l = new Label("Hello, JavaFX " + javafxVersion + ", running on Java " + javaVersion + ".");
Scene scene = new Scene(new StackPane(l), 640, 480);
stage.setScene(scene);
stage.show();
}

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


Tried to compile it with the suggested pattern:



javac --module-path $PATH_TO_FX --add-modules javafx.controls HelloFX.java



But compiler throws an error: module not found: javafx.controls.
Windows 10. Java and JavaFX versions is 11.0.1



Again: I DID ADD the line --add-modules javafx.controls










share|improve this question















migrated from superuser.com Jan 5 at 19:43


This question came from our site for computer enthusiasts and power users.
















  • Possible duplicate of Module javafx.controls not found in Java 9

    – amin saffar
    Jan 5 at 22:09
















0















I have downloaded JavaFX SDK, unpacked it and set a PATH_TO_FX system variable, following this instructions. I used following code example:



import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;

public class HelloFX extends Application {

@Override
public void start(Stage stage) {
String javaVersion = System.getProperty("java.version");
String javafxVersion = System.getProperty("javafx.version");
Label l = new Label("Hello, JavaFX " + javafxVersion + ", running on Java " + javaVersion + ".");
Scene scene = new Scene(new StackPane(l), 640, 480);
stage.setScene(scene);
stage.show();
}

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


Tried to compile it with the suggested pattern:



javac --module-path $PATH_TO_FX --add-modules javafx.controls HelloFX.java



But compiler throws an error: module not found: javafx.controls.
Windows 10. Java and JavaFX versions is 11.0.1



Again: I DID ADD the line --add-modules javafx.controls










share|improve this question















migrated from superuser.com Jan 5 at 19:43


This question came from our site for computer enthusiasts and power users.
















  • Possible duplicate of Module javafx.controls not found in Java 9

    – amin saffar
    Jan 5 at 22:09














0












0








0








I have downloaded JavaFX SDK, unpacked it and set a PATH_TO_FX system variable, following this instructions. I used following code example:



import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;

public class HelloFX extends Application {

@Override
public void start(Stage stage) {
String javaVersion = System.getProperty("java.version");
String javafxVersion = System.getProperty("javafx.version");
Label l = new Label("Hello, JavaFX " + javafxVersion + ", running on Java " + javaVersion + ".");
Scene scene = new Scene(new StackPane(l), 640, 480);
stage.setScene(scene);
stage.show();
}

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


Tried to compile it with the suggested pattern:



javac --module-path $PATH_TO_FX --add-modules javafx.controls HelloFX.java



But compiler throws an error: module not found: javafx.controls.
Windows 10. Java and JavaFX versions is 11.0.1



Again: I DID ADD the line --add-modules javafx.controls










share|improve this question
















I have downloaded JavaFX SDK, unpacked it and set a PATH_TO_FX system variable, following this instructions. I used following code example:



import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;

public class HelloFX extends Application {

@Override
public void start(Stage stage) {
String javaVersion = System.getProperty("java.version");
String javafxVersion = System.getProperty("javafx.version");
Label l = new Label("Hello, JavaFX " + javafxVersion + ", running on Java " + javaVersion + ".");
Scene scene = new Scene(new StackPane(l), 640, 480);
stage.setScene(scene);
stage.show();
}

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


Tried to compile it with the suggested pattern:



javac --module-path $PATH_TO_FX --add-modules javafx.controls HelloFX.java



But compiler throws an error: module not found: javafx.controls.
Windows 10. Java and JavaFX versions is 11.0.1



Again: I DID ADD the line --add-modules javafx.controls







java






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 6 at 14:02







Oksana Oryekhovska

















asked Jan 5 at 19:41









Oksana OryekhovskaOksana Oryekhovska

12




12




migrated from superuser.com Jan 5 at 19:43


This question came from our site for computer enthusiasts and power users.






migrated from superuser.com Jan 5 at 19:43


This question came from our site for computer enthusiasts and power users.















  • Possible duplicate of Module javafx.controls not found in Java 9

    – amin saffar
    Jan 5 at 22:09



















  • Possible duplicate of Module javafx.controls not found in Java 9

    – amin saffar
    Jan 5 at 22:09

















Possible duplicate of Module javafx.controls not found in Java 9

– amin saffar
Jan 5 at 22:09





Possible duplicate of Module javafx.controls not found in Java 9

– amin saffar
Jan 5 at 22:09












2 Answers
2






active

oldest

votes


















0














I'm using gradle and below build.gralde works fine for me (org.beryx.jlink is optional to build standalone distribution).



plugins {
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.5'
id "org.beryx.jlink" version "2.3.0" //optional for jlink
}

repositories {
mavenCentral()
}

javafx {
modules = [ 'javafx.controls' ]
}

mainClassName = 'gui.Main'





share|improve this answer































    0














    The problem was solved in 3 steps.




    1. Use %PATH_TO_FX% instead of $PATH_TO_FX in the command line.


    2. Recreate the variables (both system and user) PATH_TO_FX enclosing its value in quotation marks. As the directory "C:Program FilesJavajavafx-sdk-11.0.1" contains a space, it caused an error "invalid flag".


    3. Rebooting the computer to update the variables.







    share|improve this answer























      Your Answer






      StackExchange.ifUsing("editor", function () {
      StackExchange.using("externalEditor", function () {
      StackExchange.using("snippets", function () {
      StackExchange.snippets.init();
      });
      });
      }, "code-snippets");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "1"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54055598%2fmodule-not-found-javafx-controls%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      I'm using gradle and below build.gralde works fine for me (org.beryx.jlink is optional to build standalone distribution).



      plugins {
      id 'application'
      id 'org.openjfx.javafxplugin' version '0.0.5'
      id "org.beryx.jlink" version "2.3.0" //optional for jlink
      }

      repositories {
      mavenCentral()
      }

      javafx {
      modules = [ 'javafx.controls' ]
      }

      mainClassName = 'gui.Main'





      share|improve this answer




























        0














        I'm using gradle and below build.gralde works fine for me (org.beryx.jlink is optional to build standalone distribution).



        plugins {
        id 'application'
        id 'org.openjfx.javafxplugin' version '0.0.5'
        id "org.beryx.jlink" version "2.3.0" //optional for jlink
        }

        repositories {
        mavenCentral()
        }

        javafx {
        modules = [ 'javafx.controls' ]
        }

        mainClassName = 'gui.Main'





        share|improve this answer


























          0












          0








          0







          I'm using gradle and below build.gralde works fine for me (org.beryx.jlink is optional to build standalone distribution).



          plugins {
          id 'application'
          id 'org.openjfx.javafxplugin' version '0.0.5'
          id "org.beryx.jlink" version "2.3.0" //optional for jlink
          }

          repositories {
          mavenCentral()
          }

          javafx {
          modules = [ 'javafx.controls' ]
          }

          mainClassName = 'gui.Main'





          share|improve this answer













          I'm using gradle and below build.gralde works fine for me (org.beryx.jlink is optional to build standalone distribution).



          plugins {
          id 'application'
          id 'org.openjfx.javafxplugin' version '0.0.5'
          id "org.beryx.jlink" version "2.3.0" //optional for jlink
          }

          repositories {
          mavenCentral()
          }

          javafx {
          modules = [ 'javafx.controls' ]
          }

          mainClassName = 'gui.Main'






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 7 at 7:14









          LeonLeon

          1,138821




          1,138821

























              0














              The problem was solved in 3 steps.




              1. Use %PATH_TO_FX% instead of $PATH_TO_FX in the command line.


              2. Recreate the variables (both system and user) PATH_TO_FX enclosing its value in quotation marks. As the directory "C:Program FilesJavajavafx-sdk-11.0.1" contains a space, it caused an error "invalid flag".


              3. Rebooting the computer to update the variables.







              share|improve this answer




























                0














                The problem was solved in 3 steps.




                1. Use %PATH_TO_FX% instead of $PATH_TO_FX in the command line.


                2. Recreate the variables (both system and user) PATH_TO_FX enclosing its value in quotation marks. As the directory "C:Program FilesJavajavafx-sdk-11.0.1" contains a space, it caused an error "invalid flag".


                3. Rebooting the computer to update the variables.







                share|improve this answer


























                  0












                  0








                  0







                  The problem was solved in 3 steps.




                  1. Use %PATH_TO_FX% instead of $PATH_TO_FX in the command line.


                  2. Recreate the variables (both system and user) PATH_TO_FX enclosing its value in quotation marks. As the directory "C:Program FilesJavajavafx-sdk-11.0.1" contains a space, it caused an error "invalid flag".


                  3. Rebooting the computer to update the variables.







                  share|improve this answer













                  The problem was solved in 3 steps.




                  1. Use %PATH_TO_FX% instead of $PATH_TO_FX in the command line.


                  2. Recreate the variables (both system and user) PATH_TO_FX enclosing its value in quotation marks. As the directory "C:Program FilesJavajavafx-sdk-11.0.1" contains a space, it caused an error "invalid flag".


                  3. Rebooting the computer to update the variables.








                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jan 8 at 17:38









                  Oksana OryekhovskaOksana Oryekhovska

                  12




                  12






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54055598%2fmodule-not-found-javafx-controls%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Probability when a professor distributes a quiz and homework assignment to a class of n students.

                      Aardman Animations

                      Are they similar matrix