2

I can achieve creating exe file for normal java application. But i can not achieve exe file my javafx application.

I try change VM option.

My code summary.

#include <jni.h> int main() { JavaVM *jvm; JNIEnv *env; JavaVMInitArgs vm_args; JavaVMOption* vmOption = new JavaVMOption[3]; vmOption[0].optionString = (char *)"-Djava.class.path=..\\ayrtm.jar"; vmOption[1].optionString = (char *)"--module-path ..\\jfx\\lib"; vmOption[2].optionString = (char *)"--add-modules javafx.controls,javafx.fxml,javafx.graphics,javafx.media,javafx.web"; JavaVMInitArgs vmInitArgs; vmInitArgs.version = JNI_VERSION_10; vmInitArgs.options = vmOption; vmInitArgs.nOptions = 3; vmInitArgs.ignoreUnrecognized = JNI_TRUE; JNIEnv* env; JavaVM* jvm; jint jvmProc = (createJavaVm)(&jvm, (void**)&env, &vmInitArgs); if (jvmProc < 0 || jvm == NULL || env == NULL) { FreeLibrary(jvmDLL); cout << "create jvm error" << endl; return false; } } 

It gives ERROR

 \[info\] Registering natives for Native class \[warn\] Could not find Native class Graphics Device initialization failed for : d3d, sw Error initializing QuantumRenderer: no suitable pipeline found java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found at com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:280) at com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:244) at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:261) at com.sun.javafx.perf.PerformanceTracker.logEvent(PerformanceTracker.java:100) at javafx.scene.Node.\<clinit\>(Node.java:417) at ahmi.AHMI.\<clinit\>(AHMI.java:51) Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:94) at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124) at java.base/java.lang.Thread.run(Thread.java:1570) \[err\] Could not find or initialize main class java.lang.ExceptionInInitializerError at ahmi.AHMI.\<clinit\>(AHMI.java:51) Caused by: java.lang.RuntimeException: No toolkit found at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:273) at com.sun.javafx.perf.PerformanceTracker.logEvent(PerformanceTracker.java:100) at javafx.scene.Node.\<clinit\>(Node.java:417) ... 1 more 
6
  • 2
    Please post the error as a code. Don't post it as a plain text and don't try to escape chars with using \: select the text of the pasted error and press the button { }. Commented Feb 3, 2024 at 5:44
  • 1
    I'm guessing but it sounds like your application is failing to find Microsoft's Direct 3D DLLs. If so then it should just be a matter of including their location on your PATH. Commented Feb 3, 2024 at 5:55
  • 2
    The native libraries required by JavaFX could not be loaded. Those native libraries are the DLLs from the JavaFX SDK download. Normally they end up on the java load library path automatically for properly packaged and executed JavaFX applications. I have no idea how to make that happen with your current approach. Commented Feb 3, 2024 at 7:31
  • 1
    You can use warp packer to a create an exe out of a JavaFX application if you want. Commented Feb 3, 2024 at 7:31
  • 2
    Thank you very much for your all reply. I paste all Javafx dll's the path, it is running. Commented Feb 3, 2024 at 14:26

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.