Closed Levvy055 closed 5 years ago
I have a little demo app that runs on JDK11 with Medusa and that works just fine. Because the module javafx.controls depends on javafx.graphics and javafx.base I only import javafx.controls and that does the trick. Can you test if it also works for you? Cheers, Gerrit
Have you tried running task gradle jlink
?
ok. Found a fix. Need to add exclude option to dependencies
implementation group: 'eu.hansolo', name: 'Medusa', version: '11.1', {
exclude group: 'org.openjfx'
}
Sorry for the late reply but I’m on travel at the moment, great you figured it out on your own 👍🏻😁
Dear I did the fix and I am still having issue jlink+jpackage. The exported jar show error "Fail to launch vm". However, once I removed the eu.hansolo.medusa from the dependencies, everything going smoothly and I am able to export a runnable jar. Here my gradle script: plugins { id 'java' id 'application' id 'org.javamodularity.moduleplugin' version '1.8.12' id 'org.openjfx.javafxplugin' version '0.0.13' id 'org.beryx.jlink' version '2.25.0' }
group 'com.example'
repositories { mavenCentral() }
ext { junitVersion = '5.9.2' }
sourceCompatibility = '17' targetCompatibility = '17'
tasks.withType(JavaCompile) { options.encoding = 'UTF-8' }
application { mainModule = 'com.example.demoa' mainClass = 'com.example.demoa.HelloApplication' }
javafx { version = '20.0.1' modules = ['javafx.controls', 'javafx.fxml','javafx.swing','javafx.web'] }
dependencies {
implementation ('eu.hansolo:toolbox:17.0.43'){
exclude(group: 'org.openjfx')
}
implementation ('eu.hansolo:toolboxfx:17.0.33'){
exclude(group: 'org.openjfx')
}
implementation ('eu.hansolo:medusa:17.1.5'){
exclude (group: 'org.openjfx')
}
testImplementation("org.junit.jupiter:junit-jupiter-api:${junitVersion}")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${junitVersion}")
}
test { useJUnitPlatform() }
jlink { imageZip = project.file("${buildDir}/distributions/app-${javafx.platform.classifier}.zip") options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages'] launcher { name = 'ahmedapp' }
jpackage {
if (javafx.getPlatform().name() == "OSX") {
installerType = "dmg"
jpackageHome = "C:\\Users\\TechBeam\\.jdks\\azul-17.0.7"
} else if (javafx.getPlatform().name() == "WINDOWS") {
installerType = "msi"
jpackageHome = "C:\\Users\\TechBeam\\.jdks\\azul-17.0.7"
installerOptions = ['--win-menu', '--win-shortcut',
'--win-dir-chooser']
} else if (javafx.getPlatform().name() == "LINUX") {
installerType = "deb"
jpackageHome = "C:\\Users\\TechBeam\\.jdks\\azul-17.0.7"
}
}
}
jlinkZip { group = 'distribution' } and here my module-info : module com.example.demoa { requires javafx.controls; requires javafx.fxml; requires javafx.base; requires javafx.graphics; requires javafx.swing;
requires eu.hansolo.medusa;
opens com.example.demoa to javafx.fxml;
exports com.example.demoa;
} please any clue I am struggling with for 2 weeks without any hope.
When using jlink plugin in gradle with openjfx plugin and medusa 8.0.3 everything is fine, but when updated medusa to 11 there is following error:
Do not know if that is problem with Medusa or one of beforementioned plugins. Having followed simplified gradle additional config:
When removed javafx section there is
error: module not found: javafx.base
and so on.