javafx.base reads package javafx.beans









up vote
0
down vote

favorite












I'm using OpenJDK 11 and OpenJFX 11.0.1 with Gradle in IntelliJ IDEA for my project.
When I use javafx.base module, IntelliJ IDEA reports an error at line 1 (project module declaration) saying I'm not including the javafx.beans module (beans is a package in javafx.base module) in my module requirements.
Gradle jar task executes without any errors or warnings so this error is likely related to IntelliJ IDEA.



Error message: "Module 'hr.caellian.lunar' reads package 'javafx.beans' for both 'javafx.base' and 'javafx.base'"
If I remove 'javafx.base' requirement, 'javafx.base' from above error is replaced with the next javafx module.



I'm also getting a warnings at javafx module requirement lines: "Ambiguous module reference: javafx.base" for 'javafx.base' and so on for each javafx module.



Here's my module-info.java file:



module hr.caellian.lunar 
requires java.base;
requires kotlin.stdlib;

requires javafx.base;
requires javafx.controls;
requires javafx.fxml;
opens hr.caellian.lunar.gui to javafx.graphics;

requires org.kordamp.ikonli.javafx;
requires org.kordamp.iconli.core;

requires com.fasterxml.jackson.core;
requires com.fasterxml.jackson.databind;
requires com.fasterxml.jackson.dataformat.yaml;

requires arglib;
requires org.apache.bcel;



I looked online for a solution for at least half an hour now. All I found was a website saying only the modules I already included are necessary for JFX (which was for JavaFX 9 I think).



I redownloaded JavaFX modules to see if I missed copying something but I didn't - javafx.beans module doesn't exist.



'java --list-modules' doesn't list any javafx modules if that's a problem, although I gathered that it should only list jdk modules and OpenJFX is no longer included with OpenJDK.



I installed OpenJFX SDK into JDK folder (lib files copied to lib folder, same for legal), added javafx jar dependency files from lib folder of JDK11 in IDEA manually. I also added all jmod files to jmod folder of JDK11.



Is it possible JavaFX modules have bad module-info.java files or something like that? Is this IntelliJ IDEA bug?










share|improve this question



















  • 2




    Can you copy and paste the exact error message you're receiving?
    – Jacob G.
    Nov 9 at 19:33






  • 1




    Are you using Maven or Gradle? Else, how do you set the JavaFX SDK for IntelliJ? Do you set the module-path?
    – José Pereda
    Nov 9 at 19:53










  • @JacobG. added to the question.
    – Tin Svagelj
    Nov 9 at 20:12










  • @JoséPereda Gradle, installed JFX SDK into JDK folder, added jars manually to JDK11 for IntelliJ. I'm not setting module-path in gradle yet, not sure if I need to, but that's unrelated to the issue as IntelliJ is giving this error, not gradle, gradle jar task executes properly without errors.
    – Tin Svagelj
    Nov 9 at 20:12






  • 1




    @TinSvagelj I would guess, you've ended up placing same modules twice in your modulepath for JavaFX. Inferring this from the paragraph I installed OpenJFX SDK into JDK folder... and error Ambiguous module reference:....
    – nullpointer
    Nov 10 at 1:20















up vote
0
down vote

favorite












I'm using OpenJDK 11 and OpenJFX 11.0.1 with Gradle in IntelliJ IDEA for my project.
When I use javafx.base module, IntelliJ IDEA reports an error at line 1 (project module declaration) saying I'm not including the javafx.beans module (beans is a package in javafx.base module) in my module requirements.
Gradle jar task executes without any errors or warnings so this error is likely related to IntelliJ IDEA.



Error message: "Module 'hr.caellian.lunar' reads package 'javafx.beans' for both 'javafx.base' and 'javafx.base'"
If I remove 'javafx.base' requirement, 'javafx.base' from above error is replaced with the next javafx module.



I'm also getting a warnings at javafx module requirement lines: "Ambiguous module reference: javafx.base" for 'javafx.base' and so on for each javafx module.



Here's my module-info.java file:



module hr.caellian.lunar 
requires java.base;
requires kotlin.stdlib;

requires javafx.base;
requires javafx.controls;
requires javafx.fxml;
opens hr.caellian.lunar.gui to javafx.graphics;

requires org.kordamp.ikonli.javafx;
requires org.kordamp.iconli.core;

requires com.fasterxml.jackson.core;
requires com.fasterxml.jackson.databind;
requires com.fasterxml.jackson.dataformat.yaml;

requires arglib;
requires org.apache.bcel;



I looked online for a solution for at least half an hour now. All I found was a website saying only the modules I already included are necessary for JFX (which was for JavaFX 9 I think).



I redownloaded JavaFX modules to see if I missed copying something but I didn't - javafx.beans module doesn't exist.



'java --list-modules' doesn't list any javafx modules if that's a problem, although I gathered that it should only list jdk modules and OpenJFX is no longer included with OpenJDK.



I installed OpenJFX SDK into JDK folder (lib files copied to lib folder, same for legal), added javafx jar dependency files from lib folder of JDK11 in IDEA manually. I also added all jmod files to jmod folder of JDK11.



Is it possible JavaFX modules have bad module-info.java files or something like that? Is this IntelliJ IDEA bug?










share|improve this question



















  • 2




    Can you copy and paste the exact error message you're receiving?
    – Jacob G.
    Nov 9 at 19:33






  • 1




    Are you using Maven or Gradle? Else, how do you set the JavaFX SDK for IntelliJ? Do you set the module-path?
    – José Pereda
    Nov 9 at 19:53










  • @JacobG. added to the question.
    – Tin Svagelj
    Nov 9 at 20:12










  • @JoséPereda Gradle, installed JFX SDK into JDK folder, added jars manually to JDK11 for IntelliJ. I'm not setting module-path in gradle yet, not sure if I need to, but that's unrelated to the issue as IntelliJ is giving this error, not gradle, gradle jar task executes properly without errors.
    – Tin Svagelj
    Nov 9 at 20:12






  • 1




    @TinSvagelj I would guess, you've ended up placing same modules twice in your modulepath for JavaFX. Inferring this from the paragraph I installed OpenJFX SDK into JDK folder... and error Ambiguous module reference:....
    – nullpointer
    Nov 10 at 1:20













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I'm using OpenJDK 11 and OpenJFX 11.0.1 with Gradle in IntelliJ IDEA for my project.
When I use javafx.base module, IntelliJ IDEA reports an error at line 1 (project module declaration) saying I'm not including the javafx.beans module (beans is a package in javafx.base module) in my module requirements.
Gradle jar task executes without any errors or warnings so this error is likely related to IntelliJ IDEA.



Error message: "Module 'hr.caellian.lunar' reads package 'javafx.beans' for both 'javafx.base' and 'javafx.base'"
If I remove 'javafx.base' requirement, 'javafx.base' from above error is replaced with the next javafx module.



I'm also getting a warnings at javafx module requirement lines: "Ambiguous module reference: javafx.base" for 'javafx.base' and so on for each javafx module.



Here's my module-info.java file:



module hr.caellian.lunar 
requires java.base;
requires kotlin.stdlib;

requires javafx.base;
requires javafx.controls;
requires javafx.fxml;
opens hr.caellian.lunar.gui to javafx.graphics;

requires org.kordamp.ikonli.javafx;
requires org.kordamp.iconli.core;

requires com.fasterxml.jackson.core;
requires com.fasterxml.jackson.databind;
requires com.fasterxml.jackson.dataformat.yaml;

requires arglib;
requires org.apache.bcel;



I looked online for a solution for at least half an hour now. All I found was a website saying only the modules I already included are necessary for JFX (which was for JavaFX 9 I think).



I redownloaded JavaFX modules to see if I missed copying something but I didn't - javafx.beans module doesn't exist.



'java --list-modules' doesn't list any javafx modules if that's a problem, although I gathered that it should only list jdk modules and OpenJFX is no longer included with OpenJDK.



I installed OpenJFX SDK into JDK folder (lib files copied to lib folder, same for legal), added javafx jar dependency files from lib folder of JDK11 in IDEA manually. I also added all jmod files to jmod folder of JDK11.



Is it possible JavaFX modules have bad module-info.java files or something like that? Is this IntelliJ IDEA bug?










share|improve this question















I'm using OpenJDK 11 and OpenJFX 11.0.1 with Gradle in IntelliJ IDEA for my project.
When I use javafx.base module, IntelliJ IDEA reports an error at line 1 (project module declaration) saying I'm not including the javafx.beans module (beans is a package in javafx.base module) in my module requirements.
Gradle jar task executes without any errors or warnings so this error is likely related to IntelliJ IDEA.



Error message: "Module 'hr.caellian.lunar' reads package 'javafx.beans' for both 'javafx.base' and 'javafx.base'"
If I remove 'javafx.base' requirement, 'javafx.base' from above error is replaced with the next javafx module.



I'm also getting a warnings at javafx module requirement lines: "Ambiguous module reference: javafx.base" for 'javafx.base' and so on for each javafx module.



Here's my module-info.java file:



module hr.caellian.lunar 
requires java.base;
requires kotlin.stdlib;

requires javafx.base;
requires javafx.controls;
requires javafx.fxml;
opens hr.caellian.lunar.gui to javafx.graphics;

requires org.kordamp.ikonli.javafx;
requires org.kordamp.iconli.core;

requires com.fasterxml.jackson.core;
requires com.fasterxml.jackson.databind;
requires com.fasterxml.jackson.dataformat.yaml;

requires arglib;
requires org.apache.bcel;



I looked online for a solution for at least half an hour now. All I found was a website saying only the modules I already included are necessary for JFX (which was for JavaFX 9 I think).



I redownloaded JavaFX modules to see if I missed copying something but I didn't - javafx.beans module doesn't exist.



'java --list-modules' doesn't list any javafx modules if that's a problem, although I gathered that it should only list jdk modules and OpenJFX is no longer included with OpenJDK.



I installed OpenJFX SDK into JDK folder (lib files copied to lib folder, same for legal), added javafx jar dependency files from lib folder of JDK11 in IDEA manually. I also added all jmod files to jmod folder of JDK11.



Is it possible JavaFX modules have bad module-info.java files or something like that? Is this IntelliJ IDEA bug?







java javafx java-module java-11 openjfx






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 10 at 9:22









Mark Rotteveel

58.2k1475118




58.2k1475118










asked Nov 9 at 19:30









Tin Svagelj

446




446







  • 2




    Can you copy and paste the exact error message you're receiving?
    – Jacob G.
    Nov 9 at 19:33






  • 1




    Are you using Maven or Gradle? Else, how do you set the JavaFX SDK for IntelliJ? Do you set the module-path?
    – José Pereda
    Nov 9 at 19:53










  • @JacobG. added to the question.
    – Tin Svagelj
    Nov 9 at 20:12










  • @JoséPereda Gradle, installed JFX SDK into JDK folder, added jars manually to JDK11 for IntelliJ. I'm not setting module-path in gradle yet, not sure if I need to, but that's unrelated to the issue as IntelliJ is giving this error, not gradle, gradle jar task executes properly without errors.
    – Tin Svagelj
    Nov 9 at 20:12






  • 1




    @TinSvagelj I would guess, you've ended up placing same modules twice in your modulepath for JavaFX. Inferring this from the paragraph I installed OpenJFX SDK into JDK folder... and error Ambiguous module reference:....
    – nullpointer
    Nov 10 at 1:20













  • 2




    Can you copy and paste the exact error message you're receiving?
    – Jacob G.
    Nov 9 at 19:33






  • 1




    Are you using Maven or Gradle? Else, how do you set the JavaFX SDK for IntelliJ? Do you set the module-path?
    – José Pereda
    Nov 9 at 19:53










  • @JacobG. added to the question.
    – Tin Svagelj
    Nov 9 at 20:12










  • @JoséPereda Gradle, installed JFX SDK into JDK folder, added jars manually to JDK11 for IntelliJ. I'm not setting module-path in gradle yet, not sure if I need to, but that's unrelated to the issue as IntelliJ is giving this error, not gradle, gradle jar task executes properly without errors.
    – Tin Svagelj
    Nov 9 at 20:12






  • 1




    @TinSvagelj I would guess, you've ended up placing same modules twice in your modulepath for JavaFX. Inferring this from the paragraph I installed OpenJFX SDK into JDK folder... and error Ambiguous module reference:....
    – nullpointer
    Nov 10 at 1:20








2




2




Can you copy and paste the exact error message you're receiving?
– Jacob G.
Nov 9 at 19:33




Can you copy and paste the exact error message you're receiving?
– Jacob G.
Nov 9 at 19:33




1




1




Are you using Maven or Gradle? Else, how do you set the JavaFX SDK for IntelliJ? Do you set the module-path?
– José Pereda
Nov 9 at 19:53




Are you using Maven or Gradle? Else, how do you set the JavaFX SDK for IntelliJ? Do you set the module-path?
– José Pereda
Nov 9 at 19:53












@JacobG. added to the question.
– Tin Svagelj
Nov 9 at 20:12




@JacobG. added to the question.
– Tin Svagelj
Nov 9 at 20:12












@JoséPereda Gradle, installed JFX SDK into JDK folder, added jars manually to JDK11 for IntelliJ. I'm not setting module-path in gradle yet, not sure if I need to, but that's unrelated to the issue as IntelliJ is giving this error, not gradle, gradle jar task executes properly without errors.
– Tin Svagelj
Nov 9 at 20:12




@JoséPereda Gradle, installed JFX SDK into JDK folder, added jars manually to JDK11 for IntelliJ. I'm not setting module-path in gradle yet, not sure if I need to, but that's unrelated to the issue as IntelliJ is giving this error, not gradle, gradle jar task executes properly without errors.
– Tin Svagelj
Nov 9 at 20:12




1




1




@TinSvagelj I would guess, you've ended up placing same modules twice in your modulepath for JavaFX. Inferring this from the paragraph I installed OpenJFX SDK into JDK folder... and error Ambiguous module reference:....
– nullpointer
Nov 10 at 1:20





@TinSvagelj I would guess, you've ended up placing same modules twice in your modulepath for JavaFX. Inferring this from the paragraph I installed OpenJFX SDK into JDK folder... and error Ambiguous module reference:....
– nullpointer
Nov 10 at 1:20













1 Answer
1






active

oldest

votes

















up vote
0
down vote













Managed to fix the problem thanks to the comment from @nullpointer.



The problem was that I had copied files from JavaFX SDK to both my JDK 11 classpath and project lib folder.



If you're seeing this error with the same warnings that means you probably have duplicate module jars (maybe in future modules directly) in your IntelliJ project JDK Classpath and in your build.gradle (or lib folder).



How to fix:
I removed OpenJFX SDK jars from JDK11 Classpath in IntelliJ IDEA in Project Structure. As I deleted JFX SDK jars from my project lib folder, I readded them. Gradle adds every jar in lib folder with:



implementation fileTree(dir: 'lib', include: '**/*.jar')


Also, do not install JavaFX directly into JDK folder. It'll be impossible to update either without keeping unnecessary files, you'll never be able to find all JFX files to remove in case you want yo remove it, JFX src.zip replaces JDK src.zip in lib folder. They're meant to be separate.






share|improve this answer




















  • Also, as soon as I fixed my mistake I was no longer able to use class.getResource("path") for loading resources due to how new modules work and gradle not fully supporting them yet. If you run into issues with this, check out this question answers to which explain how to use modules and resources with Gradle.
    – Tin Svagelj
    Nov 10 at 13:56










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',
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%2f53232184%2fjavafx-base-reads-package-javafx-beans%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













Managed to fix the problem thanks to the comment from @nullpointer.



The problem was that I had copied files from JavaFX SDK to both my JDK 11 classpath and project lib folder.



If you're seeing this error with the same warnings that means you probably have duplicate module jars (maybe in future modules directly) in your IntelliJ project JDK Classpath and in your build.gradle (or lib folder).



How to fix:
I removed OpenJFX SDK jars from JDK11 Classpath in IntelliJ IDEA in Project Structure. As I deleted JFX SDK jars from my project lib folder, I readded them. Gradle adds every jar in lib folder with:



implementation fileTree(dir: 'lib', include: '**/*.jar')


Also, do not install JavaFX directly into JDK folder. It'll be impossible to update either without keeping unnecessary files, you'll never be able to find all JFX files to remove in case you want yo remove it, JFX src.zip replaces JDK src.zip in lib folder. They're meant to be separate.






share|improve this answer




















  • Also, as soon as I fixed my mistake I was no longer able to use class.getResource("path") for loading resources due to how new modules work and gradle not fully supporting them yet. If you run into issues with this, check out this question answers to which explain how to use modules and resources with Gradle.
    – Tin Svagelj
    Nov 10 at 13:56














up vote
0
down vote













Managed to fix the problem thanks to the comment from @nullpointer.



The problem was that I had copied files from JavaFX SDK to both my JDK 11 classpath and project lib folder.



If you're seeing this error with the same warnings that means you probably have duplicate module jars (maybe in future modules directly) in your IntelliJ project JDK Classpath and in your build.gradle (or lib folder).



How to fix:
I removed OpenJFX SDK jars from JDK11 Classpath in IntelliJ IDEA in Project Structure. As I deleted JFX SDK jars from my project lib folder, I readded them. Gradle adds every jar in lib folder with:



implementation fileTree(dir: 'lib', include: '**/*.jar')


Also, do not install JavaFX directly into JDK folder. It'll be impossible to update either without keeping unnecessary files, you'll never be able to find all JFX files to remove in case you want yo remove it, JFX src.zip replaces JDK src.zip in lib folder. They're meant to be separate.






share|improve this answer




















  • Also, as soon as I fixed my mistake I was no longer able to use class.getResource("path") for loading resources due to how new modules work and gradle not fully supporting them yet. If you run into issues with this, check out this question answers to which explain how to use modules and resources with Gradle.
    – Tin Svagelj
    Nov 10 at 13:56












up vote
0
down vote










up vote
0
down vote









Managed to fix the problem thanks to the comment from @nullpointer.



The problem was that I had copied files from JavaFX SDK to both my JDK 11 classpath and project lib folder.



If you're seeing this error with the same warnings that means you probably have duplicate module jars (maybe in future modules directly) in your IntelliJ project JDK Classpath and in your build.gradle (or lib folder).



How to fix:
I removed OpenJFX SDK jars from JDK11 Classpath in IntelliJ IDEA in Project Structure. As I deleted JFX SDK jars from my project lib folder, I readded them. Gradle adds every jar in lib folder with:



implementation fileTree(dir: 'lib', include: '**/*.jar')


Also, do not install JavaFX directly into JDK folder. It'll be impossible to update either without keeping unnecessary files, you'll never be able to find all JFX files to remove in case you want yo remove it, JFX src.zip replaces JDK src.zip in lib folder. They're meant to be separate.






share|improve this answer












Managed to fix the problem thanks to the comment from @nullpointer.



The problem was that I had copied files from JavaFX SDK to both my JDK 11 classpath and project lib folder.



If you're seeing this error with the same warnings that means you probably have duplicate module jars (maybe in future modules directly) in your IntelliJ project JDK Classpath and in your build.gradle (or lib folder).



How to fix:
I removed OpenJFX SDK jars from JDK11 Classpath in IntelliJ IDEA in Project Structure. As I deleted JFX SDK jars from my project lib folder, I readded them. Gradle adds every jar in lib folder with:



implementation fileTree(dir: 'lib', include: '**/*.jar')


Also, do not install JavaFX directly into JDK folder. It'll be impossible to update either without keeping unnecessary files, you'll never be able to find all JFX files to remove in case you want yo remove it, JFX src.zip replaces JDK src.zip in lib folder. They're meant to be separate.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 10 at 9:18









Tin Svagelj

446




446











  • Also, as soon as I fixed my mistake I was no longer able to use class.getResource("path") for loading resources due to how new modules work and gradle not fully supporting them yet. If you run into issues with this, check out this question answers to which explain how to use modules and resources with Gradle.
    – Tin Svagelj
    Nov 10 at 13:56
















  • Also, as soon as I fixed my mistake I was no longer able to use class.getResource("path") for loading resources due to how new modules work and gradle not fully supporting them yet. If you run into issues with this, check out this question answers to which explain how to use modules and resources with Gradle.
    – Tin Svagelj
    Nov 10 at 13:56















Also, as soon as I fixed my mistake I was no longer able to use class.getResource("path") for loading resources due to how new modules work and gradle not fully supporting them yet. If you run into issues with this, check out this question answers to which explain how to use modules and resources with Gradle.
– Tin Svagelj
Nov 10 at 13:56




Also, as soon as I fixed my mistake I was no longer able to use class.getResource("path") for loading resources due to how new modules work and gradle not fully supporting them yet. If you run into issues with this, check out this question answers to which explain how to use modules and resources with Gradle.
– Tin Svagelj
Nov 10 at 13:56

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53232184%2fjavafx-base-reads-package-javafx-beans%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

Use pre created SQLite database for Android project in kotlin

Darth Vader #20

Ondo