Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module not found error #120

Open
tahunt042 opened this issue Oct 23, 2019 · 14 comments
Open

Module not found error #120

tahunt042 opened this issue Oct 23, 2019 · 14 comments

Comments

@tahunt042
Copy link

I am using IntelliJ 2019.2.3, I set my PATH_TO_FX to C:\Program Files\Java\javafx-sdk-13.0.1, my VM options to --module-path ${PATH_TO_FX} --add-modules javafx.controls,javafx.fxml, my library for javafx 13 has been added under project settings, and I am still getting the error message
"Error occurred during initialization of boot layer
java.lang.module.FindException: Module javafx.base not found"
I'm not sure if I am missing anything. Please help.

@Mason-Chou
Copy link

PATH_TO_FX should be pointing to the lib folder. In your case it should be C:\Program Files\Java\javafx-sdk-13.0.1\lib

@avacadoadam
Copy link

I have the same bug When I search for my path in windows explorer it brings me to correct folders that contains javafx.base

@Mason-Chou
Copy link

@avacadoadam %PATH% and %PATH_TO_FX% are two different environmental variables; make sure you aren't getting confused between the two. If you want to be sure this is a bug, just hard code your module-path to your javafx-sdk-13.01\lib folder.

Below is a batch script with the hardcoded pathing. You can just copy and paste the below in a .bat file in the same directory containing HelloFX.java. Should run without any issues (assuming you have Java 13 installed).

javac --module-path "C:\Program Files\Java\javafx-sdk-13.0.1\lib" --add-modules javafx.controls HelloFX.java
java --module-path "C:\Program Files\Java\javafx-sdk-13.0.1\lib" --add-modules javafx.controls HelloFX

@harryhuk
Copy link

harryhuk commented Nov 7, 2019

I had this same problem in Netbeans 11.2, even after having correctly set the VM options for Run in project properties to set the correct modules path.

The solution for me was to turn off 'Compile on Save', as mentioned in this reply to this closed issue
#91 (comment)

Might be good to add to the docs?

@shreya888
Copy link

I am facing the same issue. I am using IDEA IntelliJ 2019.1.5 on Ubuntu 18.04. When I set PATH_TO_FX correctly to my local JFXdirectory/lib folder, I am facing the error below:

Error occurred during initialization of boot layer
java.lang.module.FindException: Module javafx.base not found

@ghost
Copy link

ghost commented Sep 6, 2020

Facing the same issue in Windows10, Intellij IDEA version 2020.2
Output -
Error occurred during initialization of boot layer java.lang.module.FindException: Module javafx.base not found
Tried all ways, also added this folder to both PATH Variable and VM options javafx-sdk-11.0.2\lib
Still, no clue how to solve this.

@jordan-git
Copy link

jordan-git commented Sep 14, 2020

Same problem as above. No clue what to do.
--module-path="C:\Program Files\OpenJFX\lib" --add-modules=javafx.controls

idea64_bOYaIHQNwo

@my-gh-account
Copy link

my-gh-account commented Sep 15, 2020

I am running JavaFX-15 with JDK-15 on Netbeans 12.0.

Go to https://openjfx.io/openjfx-docs/#install-javafx (follow the guide for "JavaFX and NetBeans -> Non-modular from IDE").

In Netbeans, turn off the "compile on save" option:

Project Properties -> Build -> Compiling ->> Compile on save (off)

This got rid of the "Error occurred during initialization of boot layer... java.lang.module.FindException: Module javafx.controls not found".

Java FX-15 works beautifully. I hope this helps someone...

===

To me, it seems like the nb-javac is causing the problem....

===
nb-javac

@doyoko
Copy link

doyoko commented Oct 11, 2020

I've just installed JDK15 and was encountering this issue as well. (macOS 10.14.6)
I used the .bash_profile environment and had defined the $PATH_TO_FX via.
vim .bash_profile
export PATH_TO_FX="/<file path including lib>" save and close (in quotation marks)
source .bash_profile load
Closed completely all terminal windows, rebooted terminal and ran echo,
echo $PATH_TO_FX, verified; and
resumed to compile and run the HelloFX file.
It may work for some, small oversight on my end

@gilbertoca
Copy link

Very strange:

gilberto.andrade@C430760:~/tmp/JAVAFX/stage$ javac -version
javac 11.0.9
gilberto.andrade@C430760:~/tmp/JAVAFX/stage$ java -version
openjdk version "11.0.9" 2020-10-20
OpenJDK Runtime Environment (build 11.0.9+11-suse-lp152.2.6.2-x8664)
OpenJDK 64-Bit Server VM (build 11.0.9+11-suse-lp152.2.6.2-x8664, mixed mode)
gilberto.andrade@C430760:~/tmp/JAVAFX/stage$ 

It is compiling ..

gilberto.andrade@C430760:~/tmp/JAVAFX/stage$ javac --module-path ~/bin/javafx-jmods-11.0.2 --add-modules javafx.controls StageExamples.java 
gilberto.andrade@C430760:~/tmp/JAVAFX/stage$ 

But not running ...

gilberto.andrade@C430760:~/tmp/JAVAFX/stage$ java --module-path ~/bin/javafx-jmods-11.0.2 --add-modules javafx.controls StageExamples
Error occurred during initialization of boot layer
java.lang.module.FindException: Module javafx.controls not found
gilberto.andrade@C430760:~/tmp/JAVAFX/stage$ 

@kevinrushforth
Copy link

You should only use the jmod files with jlink. Not with javac (although it happens to work, it isn't supported) or java.

You need to use the sdk if you want to locally compile and run.

@gilbertoca
Copy link

No way with sdk ..

gilberto.andrade@C430760:~/tmp/JAVAFX/stage$ javac --module-path ~/bin/javafx-sdk-11.0.2 --add-modules javafx.controls StageExamples.java 
error: module not found: javafx.controls
1 error

@kevinrushforth
Copy link

That should be javafx-sdk-11.0.2/lib

@gilbertoca
Copy link

gilbertoca commented Jan 9, 2021

That should be javafx-sdk-11.0.2/lib

Sorry, it was an oversight on my part.
Thank you, @kevinrushforth ! Finally it is running!

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants