JavaFX error

In my project coded with JavaFX, I get a JavaFX runtime error, and after installing with the .msi the application doesn’t run, but when I run it as a Gradle project from IntelliJ, it works.
106 Replies
JavaBot
JavaBotthis hour
This post has been reserved for your question.
Hey @feca! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
dan1st
dan1stthis hour
What exact error? Can you create it with --win-console? How are you using jpackage?
feca
fecaOPthis hour
I was trying to do it with Cursor AI in order to set it up, I have a Gradle file. Error: JavaFX runtime components are missing, and are required to run this application
dan1st
dan1stthis hour
Are you getting that with jpackage or without it?
feca
fecaOPthis hour
both but when i run with gradle, it works
dan1st
dan1st23h ago
How are you running it without jpackage that you get that error? Are you using a fat JAR? If so, that's the issue
feca
fecaOP23h ago
I’ve added --win-console to my jpackage Gradle task. Do you want me to send you my Gradle file to check?
dan1st
dan1st23h ago
please
feca
fecaOP23h ago
No, I’m not running a fat JAR. I just run it with ./gradlew run from the terminal, and it works fine there. The issue only happens after packaging with jpackage.
dan1st
dan1st23h ago
Can you please show the build script/how you are running jpackage?
feca
fecaOP23h ago
dan1st
dan1st23h ago
Do you have a module-info.java?
feca
fecaOP23h ago
cursor removed it ill add now
dan1st
dan1st23h ago
oh you are doing it manually with the JavaFX SDK...
feca
fecaOP23h ago
yes
dan1st
dan1st23h ago
yeah that is far from ideal JavaFX wants to run with a module-info.java
feca
fecaOP23h ago
Yesterday I tried every possible way, I even downloaded the JavaFX SDK, but the same error kept happening. now i added module-info.java
dan1st
dan1st23h ago
open module your.moduleName.here {
requires javafx.controls;
requires javafx.fxml;
requires javafx.graphics;
requires javafx.base;
}
open module your.moduleName.here {
requires javafx.controls;
requires javafx.fxml;
requires javafx.graphics;
requires javafx.base;
}
You should ideally get rid of the open keyword before module (and replace it with exports/opens) once the application works but it should be fine/easier for now Then you should also not need to use --add-opens
feca
fecaOP23h ago
My project is classpath-based, so Cursor removed the module-info.
dan1st
dan1st23h ago
JavaFX doesn't support using the classpath for it.
feca
fecaOP23h ago
now i added the module-info and here's my module info
module org.example.clickmaster {
requires javafx.controls;
requires javafx.fxml;
requires javafx.graphics;
requires javafx.base;

// JNativeHook - automatic module
requires static jnativehook;

// Logging
requires static ch.qos.logback.classic;
requires static ch.qos.logback.core;

// JSON processing
requires static com.fasterxml.jackson.databind;
requires static com.fasterxml.jackson.core;

// Java modules
requires java.desktop;
requires java.logging;

// Exports
exports org.example;
exports org.example.core;
exports org.example.ui;
exports org.example.ui.components;
exports org.example.utils;
exports org.example.security;
exports org.example.animation;

// Opens for reflection
opens org.example to javafx.graphics;
opens org.example.ui to javafx.fxml;
opens org.example.ui.components to javafx.fxml;
}
module org.example.clickmaster {
requires javafx.controls;
requires javafx.fxml;
requires javafx.graphics;
requires javafx.base;

// JNativeHook - automatic module
requires static jnativehook;

// Logging
requires static ch.qos.logback.classic;
requires static ch.qos.logback.core;

// JSON processing
requires static com.fasterxml.jackson.databind;
requires static com.fasterxml.jackson.core;

// Java modules
requires java.desktop;
requires java.logging;

// Exports
exports org.example;
exports org.example.core;
exports org.example.ui;
exports org.example.ui.components;
exports org.example.utils;
exports org.example.security;
exports org.example.animation;

// Opens for reflection
opens org.example to javafx.graphics;
opens org.example.ui to javafx.fxml;
opens org.example.ui.components to javafx.fxml;
}
but when i compile it
dan1st
dan1st23h ago
ok yeah that should probably be fine for the most part
feca
fecaOP23h ago
PS C:\Users\rampa\OneDrive\Desktop\Projects\ClickMaster> ./gradlew clean build
Configuration on demand is an incubating feature.
<-<<
> Task :compileJava FAILED
C:\Users\rampa\OneDrive\Desktop\Projects\ClickMaster\src\main\java\module-info.java:8: error: module not found: jnativehook
requires static jnativehook;
^
1 error

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.

* Try:
> Run with --info option to get more log output.
> Run with --scan to get full insights.

BU─░LD FAILED in 1s
2 actionable tasks: 2 executed
PS C:\Users\rampa\OneDrive\Desktop\Projects\ClickMaster>
PS C:\Users\rampa\OneDrive\Desktop\Projects\ClickMaster> ./gradlew clean build
Configuration on demand is an incubating feature.
<-<<
> Task :compileJava FAILED
C:\Users\rampa\OneDrive\Desktop\Projects\ClickMaster\src\main\java\module-info.java:8: error: module not found: jnativehook
requires static jnativehook;
^
1 error

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.

* Try:
> Run with --info option to get more log output.
> Run with --scan to get full insights.

BU─░LD FAILED in 1s
2 actionable tasks: 2 executed
PS C:\Users\rampa\OneDrive\Desktop\Projects\ClickMaster>
compile error
dan1st
dan1st23h ago
and for jpackage, you might want to do it like https://openjfx.io/openjfx-docs/#modular but we'll see about it once you get the module-info.java to work
Getting Started with JavaFX
Getting started with JavaFX for Java desktop application development
dan1st
dan1st23h ago
Is jnativehook on the modulepath?
dan1st
dan1st23h ago
GitHub
jnativehook/src/main/java/module-info.java at 2.2 · kwhat/jnativehook
Global keyboard and mouse listeners for Java. Contribute to kwhat/jnativehook development by creating an account on GitHub.
feca
fecaOP23h ago
now i see nativehook is on the classpath, not the module-path
dan1st
dan1st23h ago
it should be on the modulepath all dependencies should be in the modulepath
feca
fecaOP23h ago
im trying
dan1st
dan1st23h ago
btw since you said you weren't using a fat JAR before, you configured the project to create one:
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
What Gradle version are you using? Can you update jnativehook to version 2.2.2? I think 2.1.0 didn't support modules
feca
fecaOP23h ago
i use gradle 8.5
dan1st
dan1st23h ago
so you need to use jnativehook 2.2.2
feca
fecaOP21h ago
allright i will use jnh 2.2.2 version Here's my new build.gradle
feca
fecaOP21h ago
feca
fecaOP20h ago
/**
* ClickMaster Pro - Modüler JavaFX Uygulaması
*
* Bu modül, ClickMaster Pro uygulamasının ana modülüdür.
* JavaFX, JNativeHook, Jackson ve Logback bağımlılıklarını içerir.
*
* Modül Açıklaması:
* - JavaFX 21.0.2 modülleri (controls, fxml, graphics, base)
* - JNativeHook 2.2.2 global hotkey desteği
* - Jackson JSON işleme (core, databind)
* - Logback logging framework (classic, core, slf4j-api)
* - Java platform modülleri (desktop, logging, management, vb.)
*/
module org.example {
// JavaFX modülleri
requires javafx.controls;
requires javafx.fxml;
requires javafx.graphics;
requires javafx.base;

// JNativeHook - Global hotkey desteği
requires com.github.kwhat.jnativehook;

// Jackson JSON işleme
requires com.fasterxml.jackson.core;
requires com.fasterxml.jackson.databind;

// Logback logging framework
requires org.slf4j;
requires ch.qos.logback.classic;
requires ch.qos.logback.core;

// Java platform modülleri
requires java.desktop;
requires java.logging;
requires java.management;
requires java.naming;
requires java.security.jgss;
requires java.instrument;
requires java.scripting;
requires java.sql;
requires java.xml;

// JDK modülleri
requires jdk.unsupported;
requires jdk.crypto.ec;
requires jdk.security.auth;
requires jdk.net;

// Modül açma izinleri - JavaFX FXML için
opens org.example to javafx.fxml;
opens org.example.ui to javafx.fxml;
opens org.example.ui.components to javafx.fxml, javafx.graphics;

// Modül dışa aktarma
exports org.example;
exports org.example.ui;
exports org.example.ui.components;
}
/**
* ClickMaster Pro - Modüler JavaFX Uygulaması
*
* Bu modül, ClickMaster Pro uygulamasının ana modülüdür.
* JavaFX, JNativeHook, Jackson ve Logback bağımlılıklarını içerir.
*
* Modül Açıklaması:
* - JavaFX 21.0.2 modülleri (controls, fxml, graphics, base)
* - JNativeHook 2.2.2 global hotkey desteği
* - Jackson JSON işleme (core, databind)
* - Logback logging framework (classic, core, slf4j-api)
* - Java platform modülleri (desktop, logging, management, vb.)
*/
module org.example {
// JavaFX modülleri
requires javafx.controls;
requires javafx.fxml;
requires javafx.graphics;
requires javafx.base;

// JNativeHook - Global hotkey desteği
requires com.github.kwhat.jnativehook;

// Jackson JSON işleme
requires com.fasterxml.jackson.core;
requires com.fasterxml.jackson.databind;

// Logback logging framework
requires org.slf4j;
requires ch.qos.logback.classic;
requires ch.qos.logback.core;

// Java platform modülleri
requires java.desktop;
requires java.logging;
requires java.management;
requires java.naming;
requires java.security.jgss;
requires java.instrument;
requires java.scripting;
requires java.sql;
requires java.xml;

// JDK modülleri
requires jdk.unsupported;
requires jdk.crypto.ec;
requires jdk.security.auth;
requires jdk.net;

// Modül açma izinleri - JavaFX FXML için
opens org.example to javafx.fxml;
opens org.example.ui to javafx.fxml;
opens org.example.ui.components to javafx.fxml, javafx.graphics;

// Modül dışa aktarma
exports org.example;
exports org.example.ui;
exports org.example.ui.components;
}
And module-info I switched 2.2.2 version for jnativehook When i runs with batch file, it works. But i want to its work with directly The batch file content:
@echo off
REM ClickMaster Pro Launcher
REM Gradle run kullanarak çalıştırır

cd /d "C:\Users\rampa\OneDrive\Desktop\Projects\ClickMaster Pro"

REM Gradle run ile çalıştır
gradlew.bat run

pause
@echo off
REM ClickMaster Pro Launcher
REM Gradle run kullanarak çalıştırır

cd /d "C:\Users\rampa\OneDrive\Desktop\Projects\ClickMaster Pro"

REM Gradle run ile çalıştır
gradlew.bat run

pause
dan1st
dan1st18h ago
Wha happens when you run the project now? Also why are you using jdk.unsupported? And also java.desktop, java.management, java.naming, java.scripting, crypto/security modules and many others?
feca
fecaOP17h ago
I was developing this project with JDK 24 at the beginning, but then a friend told me that it’s not an LTS and suggested I switch to JDK 21 or 17, so I moved to 21. I actually had those parts of the project made by Cursor AI. Now I’m trying to create an installer with JPackage, but after I open and install the .msi file, when I try to launch the .lnk shortcut on the desktop, nothing shows up. but when i try to run with ./gradlew run, it works i dont understand
dan1st
dan1st17h ago
actually had those parts of the project made by Cursor AI
This is not an excuse for writing bad code in any way. You are responsible for the code you are writing. You need to understand everything you are writing.
an installer with JPackage, but after I open and install the .msi file, when I try to launch the .lnk shortcut on the desktop, nothing shows up
Does it work with the module-info.java without jpackage?
feca
fecaOP17h ago
Yes, I know, I’m still a new developer and I’m working on understanding the code. When I run the project from the terminal with Gradle, it works fine. However, when I try to run it directly using Shift + F9, I get the following error: 'Error: JavaFX runtime components are missing, and are required to run this application.' By the way, do you have any tips on how I can get better at Java? You seem to know it really well, and I’d love to improve and one day reach a senior level too. Even a bug like this has been keeping me stuck for days.
dan1st
dan1st16h ago
I see. Can you try reimporting the project into your IDE? My main tip is not relying on AI tools also modularity issues can be complicated and being stuck at these for a long time is normal ;)
feca
fecaOP16h ago
i did it 3 times i see thank you :D
dan1st
dan1st16h ago
Is JavaFX on your modulepath in your IDE?
feca
fecaOP16h ago
No description
dan1st
dan1st16h ago
Can you show the full text shown in the console? I think IntelliJ should show the full command at the start
feca
fecaOP16h ago
19:54:17: Executing ':org.example.ClickMasterApp.main()'…

Configuration on demand is an incubating feature.
> Task :compileJava UP-TO-DATE
> Task :processResources UP-TO-DATE
> Task :classes UP-TO-DATE

> Task :org.example.ClickMasterApp.main() FAILED
3 actionable tasks: 1 executed, 2 up-to-date
Error: JavaFX runtime components are missing, and are required to run this application

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':org.example.ClickMasterApp.main()'.
> Process 'command 'C:\Program Files\Java\jdk-21\bin\java.exe'' finished with non-zero exit value 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUİLD FAILED in 449ms
19:54:18: Execution finished ':org.example.ClickMasterApp.main()'.
19:54:17: Executing ':org.example.ClickMasterApp.main()'…

Configuration on demand is an incubating feature.
> Task :compileJava UP-TO-DATE
> Task :processResources UP-TO-DATE
> Task :classes UP-TO-DATE

> Task :org.example.ClickMasterApp.main() FAILED
3 actionable tasks: 1 executed, 2 up-to-date
Error: JavaFX runtime components are missing, and are required to run this application

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':org.example.ClickMasterApp.main()'.
> Process 'command 'C:\Program Files\Java\jdk-21\bin\java.exe'' finished with non-zero exit value 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUİLD FAILED in 449ms
19:54:18: Execution finished ':org.example.ClickMasterApp.main()'.
this error shown me when i start with shift + f9
dan1st
dan1st16h ago
oh right IntelliJ just runs Gradle
feca
fecaOP16h ago
yes i can only run this project with gradle
dan1st
dan1st16h ago
Does the same issue occur when running it from the command line with Gradle?
feca
fecaOP16h ago
PS C:\Users\rampa\OneDrive\Desktop\Projects\ClickMaster Pro> ./gradlew run Configuration on demand is an incubating feature. <---<<<<<<<<<<<
Task :runn
ClickMaster Pro v2.0.1 starting... Launching JavaFX application... Initializing engines... ClickerEngine initialized HotkeyEngine initialized Setting up UI... Creating MainView... . . . so it runs with gradle
dan1st
dan1st16h ago
I think it's related to that
run {
// Modül path ayarları
jvmArgs = [
'--add-modules', 'javafx.controls,javafx.fxml,javafx.graphics,javafx.base',
'--add-opens', 'java.base/java.lang=ALL-UNNAMED',
'--add-opens', 'java.base/java.util=ALL-UNNAMED',
'--add-opens', 'java.desktop/java.awt=ALL-UNNAMED',
'--add-opens', 'java.desktop/java.awt.event=ALL-UNNAMED',
'--module-path', configurations.runtimeClasspath.asPath
]

// IntelliJ IDEA için ek ayarlar
standardInput = System.in
standardOutput = System.out
errorOutput = System.err
}
run {
// Modül path ayarları
jvmArgs = [
'--add-modules', 'javafx.controls,javafx.fxml,javafx.graphics,javafx.base',
'--add-opens', 'java.base/java.lang=ALL-UNNAMED',
'--add-opens', 'java.base/java.util=ALL-UNNAMED',
'--add-opens', 'java.desktop/java.awt=ALL-UNNAMED',
'--add-opens', 'java.desktop/java.awt.event=ALL-UNNAMED',
'--module-path', configurations.runtimeClasspath.asPath
]

// IntelliJ IDEA için ek ayarlar
standardInput = System.in
standardOutput = System.out
errorOutput = System.err
}
Can you try to remove the following temporarily/for testing?
'--add-modules', 'javafx.controls,javafx.fxml,javafx.graphics,javafx.base',
'--add-opens', 'java.base/java.lang=ALL-UNNAMED',
'--add-opens', 'java.base/java.util=ALL-UNNAMED',
'--add-opens', 'java.desktop/java.awt=ALL-UNNAMED',
'--add-opens', 'java.desktop/java.awt.event=ALL-UNNAMED',
'--add-modules', 'javafx.controls,javafx.fxml,javafx.graphics,javafx.base',
'--add-opens', 'java.base/java.lang=ALL-UNNAMED',
'--add-opens', 'java.base/java.util=ALL-UNNAMED',
'--add-opens', 'java.desktop/java.awt=ALL-UNNAMED',
'--add-opens', 'java.desktop/java.awt.event=ALL-UNNAMED',
Where do you have your module-info.java?
feca
fecaOP16h ago
/**
* ClickMaster Pro - Modüler JavaFX Uygulaması
*
* Bu modül, ClickMaster Pro uygulamasının ana modülüdür.
* JavaFX, JNativeHook, Jackson ve Logback bağımlılıklarını içerir.
*
* Modül Açıklaması:
* - JavaFX 21.0.2 modülleri (controls, fxml, graphics, base)
* - JNativeHook 2.2.2 global hotkey desteği
* - Jackson JSON işleme (core, databind)
* - Logback logging framework (classic, core, slf4j-api)
* - Java platform modülleri (desktop, logging, management, vb.)
*/
module org.example {
// JavaFX modülleri
requires javafx.controls;
requires javafx.fxml;
requires javafx.graphics;
requires javafx.base;

// JNativeHook - Global hotkey desteği
requires com.github.kwhat.jnativehook;

// Jackson JSON işleme
requires com.fasterxml.jackson.core;
requires com.fasterxml.jackson.databind;

// Logback logging framework
requires org.slf4j;
requires ch.qos.logback.classic;
requires ch.qos.logback.core;

// Java platform modülleri
requires java.desktop;
requires java.logging;
requires java.management;
requires java.naming;
requires java.security.jgss;
requires java.instrument;
requires java.scripting;
requires java.sql;
requires java.xml;

// JDK modülleri
requires jdk.unsupported;
requires jdk.crypto.ec;
requires jdk.security.auth;
requires jdk.net;

// Modül açma izinleri - JavaFX FXML için
opens org.example to javafx.fxml;
opens org.example.ui to javafx.fxml;
opens org.example.ui.components to javafx.fxml, javafx.graphics;

// Modül dışa aktarma
exports org.example;
exports org.example.ui;
exports org.example.ui.components;
}
/**
* ClickMaster Pro - Modüler JavaFX Uygulaması
*
* Bu modül, ClickMaster Pro uygulamasının ana modülüdür.
* JavaFX, JNativeHook, Jackson ve Logback bağımlılıklarını içerir.
*
* Modül Açıklaması:
* - JavaFX 21.0.2 modülleri (controls, fxml, graphics, base)
* - JNativeHook 2.2.2 global hotkey desteği
* - Jackson JSON işleme (core, databind)
* - Logback logging framework (classic, core, slf4j-api)
* - Java platform modülleri (desktop, logging, management, vb.)
*/
module org.example {
// JavaFX modülleri
requires javafx.controls;
requires javafx.fxml;
requires javafx.graphics;
requires javafx.base;

// JNativeHook - Global hotkey desteği
requires com.github.kwhat.jnativehook;

// Jackson JSON işleme
requires com.fasterxml.jackson.core;
requires com.fasterxml.jackson.databind;

// Logback logging framework
requires org.slf4j;
requires ch.qos.logback.classic;
requires ch.qos.logback.core;

// Java platform modülleri
requires java.desktop;
requires java.logging;
requires java.management;
requires java.naming;
requires java.security.jgss;
requires java.instrument;
requires java.scripting;
requires java.sql;
requires java.xml;

// JDK modülleri
requires jdk.unsupported;
requires jdk.crypto.ec;
requires jdk.security.auth;
requires jdk.net;

// Modül açma izinleri - JavaFX FXML için
opens org.example to javafx.fxml;
opens org.example.ui to javafx.fxml;
opens org.example.ui.components to javafx.fxml, javafx.graphics;

// Modül dışa aktarma
exports org.example;
exports org.example.ui;
exports org.example.ui.components;
}
in the src > main > java > module-info.java
feca
fecaOP16h ago
i did it
No description
dan1st
dan1st16h ago
Does gradlew run still work?
feca
fecaOP16h ago
yes it works
dan1st
dan1st16h ago
Does it also work if you remove the entire jvmArgs = [ ... ] block?
feca
fecaOP16h ago
lets try it works
dan1st
dan1st16h ago
Can you show the run configuration in IntelliJ?
feca
fecaOP16h ago
No description
dan1st
dan1st16h ago
Can you remove the JVM args from it?
feca
fecaOP16h ago
like this?
No description
dan1st
dan1st16h ago
yes
feca
fecaOP16h ago
Error: JavaFX runtime components are missing, and are required to run this application
feca
fecaOP16h ago
20:02:23: Executing ':org.example.ClickMasterApp.main()'… Configuration on demand is an incubating feature.
Task :compileJava UP-TO-DATE Task :processResources UP-TO-DATE Task :classes UP-TO-DATE
Task :org.example.ClickMasterApp.main() FAILED
3 actionable tasks: 1 executed, 2 up-to-date Error: JavaFX runtime components are missing, and are required to run this application FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':org.example.ClickMasterApp.main()'.
Process 'command 'C:\Program Files\Java\jdk-21\bin\java.exe'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. Get more help at https://help.gradle.org.
BUİLD FAILED in 355ms 20:02:24: Execution finished ':org.example.ClickMasterApp.main()'.
dan1st
dan1st16h ago
Can you remove the run configuration and restart it?
feca
fecaOP16h ago
i start with current file
No description
feca
fecaOP16h ago
and again...
dan1st
dan1st16h ago
Can you run gradlew :org.example.ClickMasterApp.main()? Does that do anything?
feca
fecaOP16h ago
PS C:\Users\rampa\OneDrive\Desktop\Projects\ClickMaster Pro> ./gradlew :org.example.ClickMasterApp.main()

At line:1 char:44
+ ./gradlew :org.example.ClickMasterApp.main()
+ ~
An expression was expected after '('.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : ExpectedExpression

PS C:\Users\rampa\OneDrive\Desktop\Projects\ClickMaster Pro>
PS C:\Users\rampa\OneDrive\Desktop\Projects\ClickMaster Pro> ./gradlew :org.example.ClickMasterApp.main()

At line:1 char:44
+ ./gradlew :org.example.ClickMasterApp.main()
+ ~
An expression was expected after '('.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : ExpectedExpression

PS C:\Users\rampa\OneDrive\Desktop\Projects\ClickMaster Pro>
dan1st
dan1st16h ago
oh I just saw that - you would also need to remove that
No description
feca
fecaOP16h ago
then it being like this
No description
dan1st
dan1st16h ago
What options are there in that menu?
feca
fecaOP16h ago
sdk and the main class
dan1st
dan1st16h ago
I meant in that menu
No description
feca
fecaOP16h ago
oh
No description
feca
fecaOP16h ago
if i select clickmaster_pro.main
feca
fecaOP16h ago
No description
dan1st
dan1st16h ago
yeah it should be that one but the -cp looks wrong
feca
fecaOP16h ago
No description
dan1st
dan1st16h ago
that is with the main one?
feca
fecaOP16h ago
No description
dan1st
dan1st16h ago
use the one with .main
feca
fecaOP16h ago
Using this
dan1st
dan1st16h ago
Is there a Use classpath of module setting anywhere?
feca
fecaOP16h ago
here's the all menu
No description
feca
fecaOP16h ago
i think there isnt or i couldnt see
dan1st
dan1st16h ago
and it works with none of the options?
feca
fecaOP16h ago
I tried every setting, but nothing worked.
dan1st
dan1st16h ago
Can you remove the run configuration and just start it again?
feca
fecaOP16h ago
oh i find a way
feca
fecaOP16h ago
No description
feca
fecaOP16h ago
when i do this it works
dan1st
dan1st16h ago
For jpackage, I'd do it similar to https://openjfx.io/openjfx-docs/#modular
Getting Started with JavaFX
Getting started with JavaFX for Java desktop application development
dan1st
dan1st16h ago
so instead of your custom jpackage command, you would do it somewhat similar to
jlink {
jpackage {
// jpackage options here
// for example
imageName = 'yourAppNameHere'
imageOptions = ['--win-console']
}
}
jlink {
jpackage {
// jpackage options here
// for example
imageName = 'yourAppNameHere'
imageOptions = ['--win-console']
}
}
in your build.gradle
feca
fecaOP16h ago
what if
jlink {
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']

mergedModule {
requires 'javafx.controls'
requires 'javafx.fxml'
}

launcher {
name = 'clickmaster'
mainClass = 'org.example.ClickMasterApp'
}

jpackage {
installerType = 'msi'
installerOptions = [
'--win-per-user-install',
'--win-dir-chooser',
'--win-menu',
'--win-shortcut',
'--win-console'
]
}
}

jlink {
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']

mergedModule {
requires 'javafx.controls'
requires 'javafx.fxml'
}

launcher {
name = 'clickmaster'
mainClass = 'org.example.ClickMasterApp'
}

jpackage {
installerType = 'msi'
installerOptions = [
'--win-per-user-install',
'--win-dir-chooser',
'--win-menu',
'--win-shortcut',
'--win-console'
]
}
}

dan1st
dan1st16h ago
yeah something like that
feca
fecaOP16h ago
then
dan1st
dan1st16h ago
Why that?
mergedModule {
requires 'javafx.controls'
requires 'javafx.fxml'
}
mergedModule {
requires 'javafx.controls'
requires 'javafx.fxml'
}
feca
fecaOP16h ago
is that it tells JLink to create a custom merged module by combining your own module with the specified modules. However, in many cases this is unnecessary or can complicate things, because you already have a modular project (module-info.java). Using addModules is simpler and safer, as it just includes the required JavaFX modules in the runtime image without creating a merged module.
dan1st
dan1st16h ago
but why are you using it here? Also I asked you and not your LLM
feca
fecaOP16h ago
because I didn’t want the user to get an error after installing the setup via .msi and i trying some ways
dan1st
dan1st16h ago
which error are you getting without it? that mergedModule setup is definitely not something JavaFX supports
feca
fecaOP16h ago
honestly, every time I ran it, I got a JavaFX runtime error. In the file that came from the setup, when I tried to run the desktop file, nothing appeared on the screen, meaning it didn’t open then, what if:
jlink {
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']

launcher {
name = 'clickmaster'
mainClass = 'org.example.ClickMasterApp'
}

jpackage {
installerType = 'msi'
installerOptions = [
'--win-per-user-install',
'--win-dir-chooser',
'--win-menu',
'--win-shortcut',
'--win-console'
]
}
}
jlink {
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']

launcher {
name = 'clickmaster'
mainClass = 'org.example.ClickMasterApp'
}

jpackage {
installerType = 'msi'
installerOptions = [
'--win-per-user-install',
'--win-dir-chooser',
'--win-menu',
'--win-shortcut',
'--win-console'
]
}
}
is it work?
PS C:\Users\rampa\OneDrive\Desktop\Projects\ClickMaster Pro> ./gradlew jLink
Configuration on demand is an incubating feature.
<<<<<<<<<<<
> Task :compileJava
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
<<<
BU─░LD SUCCESSFUL in 4s
8 actionable tasks: 1 executed, 7 up-to-date
PS C:\Users\rampa\OneDrive\Desktop\Projects\ClickMaster Pro> ./gradlew jLink
Configuration on demand is an incubating feature.
<<<<<<<<<<<
> Task :compileJava
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
<<<
BU─░LD SUCCESSFUL in 4s
8 actionable tasks: 1 executed, 7 up-to-date
jlink build is successful
dan1st
dan1st15h ago
we can try Did that generate an msi? I think you need ./gradlew jpackage though
feca
fecaOP15h ago
msi file created but still isn't working. but ill try some way now.
dan1st
dan1st15h ago
What happens when installing the msi and then running the installed app from the console?
JavaBot
JavaBot10h ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.

Did you find this page helpful?