OmixVisualization / qtjambi

QtJambi is a wrapper for using Qt in Java.
http://www.qtjambi.io
Other
354 stars 40 forks source link

QLibraryNotFoundError #207

Closed alkaid616 closed 3 weeks ago

alkaid616 commented 3 weeks ago

Describe the bug QLibraryNotFoundError: Library QtJambiUiTools (QtJambiUiTools6.dll, QtJambiUiTools.dll) was not found

To Reproduce Steps to reproduce the behavior:

  1. Go to 'https://github.com/alkaid616/kotlin-qt-demo.git' clone it
  2. open in idea
  3. Click gradle->kotlin-qt-demo->shadow->shadowjar
  4. java -jar the jar
  5. See error

Expected behavior The program is running normally

Screenshots image

System (please complete the following information):

Additional context

omix commented 3 weeks ago

QtJambi does not find the library. Is qtjambi-uitools-native-windows-x64-6.7.2 in your classpath?

alkaid616 commented 3 weeks ago

QtJambi 找不到该库。 qtjambi-uitools-native-windows-x64-6.7.2 在您的类路径中吗? image The bin directory of the generated jar package contains QtJambiUiTools6. dll, but it cannot be loaded correctly into the class path. I just found out that the directory in the/META-INF/qtjambi-deployment.xml file is not included correctly. After manually adding it, it will run correctly.So the real problem is why this file was not generated correctly. image

alkaid616 commented 3 weeks ago

The issue has been resolved by configuring Gradle. Thank you for your reply.

tasks.shadowJar {
    manifest {
        attributes["Main-Class"] = "MainKt"
    }
    transform(XmlAppendingTransformer::class.java){
        resource = "META-INF/qtjambi-deployment.xml"
    }
}