May 16, 2022 Replies: 51 As shared in multiple places in this forum Java 11 OpenJDK does not allow to run jar files directly. (here) Here is an easy workaround... 1. Run cmd with administrator privilege. 2. Type the following two commands: B4X: ftype JARFile="c:\java\bin\javaw.exe" -jar --module-path c:\java\javafx\lib --add-modules javafx.controls "%1" %*" assoc .jar=JARFile Replace the path "c:\java\bin\javaw.exe" and "c:\java\javafx\lib" based on your installed java folder. UPDATE 16/03/2023: If you have OpenJDK version greater than 11 and you are still unable to run a GUI based jar then try edit in Registry 1. Navigate to Computer\HKEY_CLASSES_ROOT\JARFile\Shell\Open\Command 2. In Default put this value (replace path with your java and javafx lib path) : Code: "c:\java\bin\javaw.exe" -jar --add-opens javafx.controls/com.sun.javafx.scene.control.skin=ALL-UNNAMED --module-path c:\java\javafx\lib --add-modules javafx.controls,javafx.web "%1" %* Cheers! Last edited: Mar 16, 2023 Click to expand...
As shared in multiple places in this forum Java 11 OpenJDK does not allow to run jar files directly. (here) Here is an easy workaround... 1. Run cmd with administrator privilege. 2. Type the following two commands: B4X: ftype JARFile="c:\java\bin\javaw.exe" -jar --module-path c:\java\javafx\lib --add-modules javafx.controls "%1" %*" assoc .jar=JARFile Replace the path "c:\java\bin\javaw.exe" and "c:\java\javafx\lib" based on your installed java folder. UPDATE 16/03/2023: If you have OpenJDK version greater than 11 and you are still unable to run a GUI based jar then try edit in Registry 1. Navigate to Computer\HKEY_CLASSES_ROOT\JARFile\Shell\Open\Command 2. In Default put this value (replace path with your java and javafx lib path) : Code: "c:\java\bin\javaw.exe" -jar --add-opens javafx.controls/com.sun.javafx.scene.control.skin=ALL-UNNAMED --module-path c:\java\javafx\lib --add-modules javafx.controls,javafx.web "%1" %* Cheers!
LucaMs Expert Licensed User Longtime User Sep 18, 2025 #21 (The browser finally worked!) If you see Java Help, the variables are correct and you can follow the steps from the beginning of this thread.
(The browser finally worked!) If you see Java Help, the variables are correct and you can follow the steps from the beginning of this thread.
M Mark Stuart Well-Known Member Licensed User Longtime User Sep 18, 2025 #22 C:\Users\Mark>ftype JARFile="c:\java\jdk-19.0.2\bin\javaw.exe" -jar --module-path c:\java\jdk-19.0.2\javafx\lib --add-modules javafx.controls "%1" %*" File type 'JARFile' not found or no open command associated with it.
C:\Users\Mark>ftype JARFile="c:\java\jdk-19.0.2\bin\javaw.exe" -jar --module-path c:\java\jdk-19.0.2\javafx\lib --add-modules javafx.controls "%1" %*" File type 'JARFile' not found or no open command associated with it.
LucaMs Expert Licensed User Longtime User Sep 18, 2025 #23 We're (I'm) screwing up: jdk 19 doesn't have c:\java\javafx\lib This thread is about Running Jar with double click (in Java OpenJDK 11+ )
We're (I'm) screwing up: jdk 19 doesn't have c:\java\javafx\lib This thread is about Running Jar with double click (in Java OpenJDK 11+ )
M Mark Stuart Well-Known Member Licensed User Longtime User Sep 18, 2025 #24 LucaMs said: We're (I'm) screwing up: jdk 19 doesn't have c:\java\javafx\lib This thread is about Running Jar with double click (in Java OpenJDK 11+ ) Click to expand... Mine does. My java folder is a direct reflection of the installation directions from the B4X webpage. Attachments jAVAfx_lIB.png 32.3 KB · Views: 298
LucaMs said: We're (I'm) screwing up: jdk 19 doesn't have c:\java\javafx\lib This thread is about Running Jar with double click (in Java OpenJDK 11+ ) Click to expand... Mine does. My java folder is a direct reflection of the installation directions from the B4X webpage.
LucaMs Expert Licensed User Longtime User Sep 18, 2025 #25 LucaMs said: jdk 19 doesn't have c:\java\javafx\lib Click to expand... Download and install it: https://www.oracle.com/java/technologies/install-javafx-sdk.html
LucaMs said: jdk 19 doesn't have c:\java\javafx\lib Click to expand... Download and install it: https://www.oracle.com/java/technologies/install-javafx-sdk.html
M Mark Stuart Well-Known Member Licensed User Longtime User Sep 18, 2025 #27 LucaMs said: Download and install it: https://www.oracle.com/java/technologies/install-javafx-sdk.html Click to expand... I won't do the install as yet. I need confirmation from @Erel to see if this is really required. After all, the B4X webpage did instruct us to download this: OpenJDK 19 + OpenJFX: download link. Shouldn't that download contain the JavaFX that the Oracle page has on it?
LucaMs said: Download and install it: https://www.oracle.com/java/technologies/install-javafx-sdk.html Click to expand... I won't do the install as yet. I need confirmation from @Erel to see if this is really required. After all, the B4X webpage did instruct us to download this: OpenJDK 19 + OpenJFX: download link. Shouldn't that download contain the JavaFX that the Oracle page has on it?
LucaMs Expert Licensed User Longtime User Sep 18, 2025 #28 Mark Stuart said: I won't do the install as yet. I need confirmation from @Erel to see if this is really required. After all, the B4X webpage did instruct us to download this: OpenJDK 19 + OpenJFX: download link. Shouldn't that download contain the JavaFX that the Oracle page has on it? Click to expand... Your message arrived while I was typing mine. You already have JavaFx, so that's fine. Mark Stuart said: Mine does Click to expand...
Mark Stuart said: I won't do the install as yet. I need confirmation from @Erel to see if this is really required. After all, the B4X webpage did instruct us to download this: OpenJDK 19 + OpenJFX: download link. Shouldn't that download contain the JavaFX that the Oracle page has on it? Click to expand... Your message arrived while I was typing mine. You already have JavaFx, so that's fine. Mark Stuart said: Mine does Click to expand...
M Mark Stuart Well-Known Member Licensed User Longtime User Sep 18, 2025 #29 LucaMs said: Your message arrived while I was typing mine. You already have JavaFx, so that's fine. Click to expand... So why don't the ftype commands work in the CMD window? This shouldn't be that complicated!
LucaMs said: Your message arrived while I was typing mine. You already have JavaFx, so that's fine. Click to expand... So why don't the ftype commands work in the CMD window? This shouldn't be that complicated!
LucaMs Expert Licensed User Longtime User Sep 18, 2025 #30 LucaMs said: java -? works (dos window)? Click to expand... try that
M Mark Stuart Well-Known Member Licensed User Longtime User Sep 18, 2025 #31 LucaMs said: try that Click to expand... try what?
LucaMs Expert Licensed User Longtime User Sep 18, 2025 #32 open a dos window (with administrator rights) and: c:\>java -? enter you should see the help
M Mark Stuart Well-Known Member Licensed User Longtime User Sep 18, 2025 #33 I already did that. C:\Users\Mark>ftype JARFile="c:\java\jdk-19.0.2\bin\javaw.exe" -jar --module-path c:\java\jdk-19.0.2\javafx\lib --add-modules javafx.controls "%1" %*" File type 'JARFile' not found or no open command associated with it.
I already did that. C:\Users\Mark>ftype JARFile="c:\java\jdk-19.0.2\bin\javaw.exe" -jar --module-path c:\java\jdk-19.0.2\javafx\lib --add-modules javafx.controls "%1" %*" File type 'JARFile' not found or no open command associated with it.
LucaMs Expert Licensed User Longtime User Sep 18, 2025 #34 Mark, please, help me... to help you If you run, inside A DOS window: java -? and press Enter, do you see Java Help in the DOS window?
Mark, please, help me... to help you If you run, inside A DOS window: java -? and press Enter, do you see Java Help in the DOS window?
M Mark Stuart Well-Known Member Licensed User Longtime User Sep 18, 2025 #35 LucaMs said: Mark, please, help me... to help you If you run, inside A DOS window: java -? and press Enter, do you see Java Help in the DOS window? Click to expand... Yes. I ran the above command. Didn't you see that? And I did run java -? I saw all the command options. I don't know what to do with all that.
LucaMs said: Mark, please, help me... to help you If you run, inside A DOS window: java -? and press Enter, do you see Java Help in the DOS window? Click to expand... Yes. I ran the above command. Didn't you see that? And I did run java -? I saw all the command options. I don't know what to do with all that.
LucaMs Expert Licensed User Longtime User Sep 18, 2025 #36 LucaMs said: Mark, please, help me... to help you If you run, inside A DOS window: java -? and press Enter, do you see Java Help in the DOS window? Click to expand... It seems that b4x.com does not allow a dos window image?! I can't post it Trying again...
LucaMs said: Mark, please, help me... to help you If you run, inside A DOS window: java -? and press Enter, do you see Java Help in the DOS window? Click to expand... It seems that b4x.com does not allow a dos window image?! I can't post it Trying again...
LucaMs Expert Licensed User Longtime User Sep 18, 2025 #37 Mark Stuart said: I saw all the command options. I don't know what to do with all that. Click to expand... It was just a test to check if you could run Java from anywhere, i.e. if the system variables are correct.
Mark Stuart said: I saw all the command options. I don't know what to do with all that. Click to expand... It was just a test to check if you could run Java from anywhere, i.e. if the system variables are correct.
M Mark Stuart Well-Known Member Licensed User Longtime User Sep 18, 2025 #38 LucaMs said: It was just a test to check if you could run Java from anywhere, i.e. if the system variables are correct. Click to expand... This is going nowhere. Good nite.
LucaMs said: It was just a test to check if you could run Java from anywhere, i.e. if the system variables are correct. Click to expand... This is going nowhere. Good nite.
LucaMs Expert Licensed User Longtime User Sep 18, 2025 #39 In the DOS window, try this first: assoc .jar=JARFile (+ enter, obviously)
M Mark Stuart Well-Known Member Licensed User Longtime User Sep 18, 2025 #40 C:\Users\Mark>assoc .jar=JARFILE Access is denied. Error occurred while processing: .jar.