Module not found: javafx.controls
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
migrated from superuser.com Jan 5 at 19:43
This question came from our site for computer enthusiasts and power users.
add a comment |
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
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
add a comment |
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
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
java
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
add a comment |
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
add a comment |
2 Answers
2
active
oldest
votes
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'
add a comment |
The problem was solved in 3 steps.
Use %PATH_TO_FX% instead of $PATH_TO_FX in the command line.
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".
Rebooting the computer to update the variables.
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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'
add a comment |
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'
add a comment |
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'
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'
answered Jan 7 at 7:14
LeonLeon
1,154821
1,154821
add a comment |
add a comment |
The problem was solved in 3 steps.
Use %PATH_TO_FX% instead of $PATH_TO_FX in the command line.
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".
Rebooting the computer to update the variables.
add a comment |
The problem was solved in 3 steps.
Use %PATH_TO_FX% instead of $PATH_TO_FX in the command line.
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".
Rebooting the computer to update the variables.
add a comment |
The problem was solved in 3 steps.
Use %PATH_TO_FX% instead of $PATH_TO_FX in the command line.
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".
Rebooting the computer to update the variables.
The problem was solved in 3 steps.
Use %PATH_TO_FX% instead of $PATH_TO_FX in the command line.
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".
Rebooting the computer to update the variables.
answered Jan 8 at 17:38
Oksana OryekhovskaOksana Oryekhovska
12
12
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
Possible duplicate of Module javafx.controls not found in Java 9
– amin saffar
Jan 5 at 22:09