'Where/how to get the MSVC dlls Java 1.8.0_144 wants?

I'm experimenting with building my application with Java 1.8.0_144 to workaround an issue that apparently started after that. I run this command to build:

gradle jfxNative -Dorg.gradle.java.home="c:\Program Files\Java\jdk1.8.0_144"

and it stops with this error:

Execution failed for task ':jfxNative'.
> Not found MSVC dlls

Where and how do I get these MSVC dlls?

The full output looks like this:

c:\...\>gradle jfxNative -Dorg.gradle.java.home="c:\Program Files\Java\jdk1.8.0_144"

> Task :jfxNative 
The jar lib\lombok-1.16.18.jar has a main class lombok.launch.Main that does not match the declared main tech.dashman.dashman.ConfiguratorApp
The jar lib\jna-4.5.0.jar has a main class com.sun.jna.Native that does not match the declared main tech.dashman.dashman.ConfiguratorApp
The jar lib\javassist-3.22.0-CR2.jar has a main class javassist.CtClass that does not match the declared main tech.dashman.dashman.ConfiguratorApp


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':jfxNative'.
> Not found MSVC dlls

* 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

BUILD FAILED in 8s
5 actionable tasks: 2 executed, 3 up-to-date

My current list of dependencies look like this:

dependencies {
    compile "tech.dashman:dashmancommon:1.0.0-SNAPSHOT"
    compile "org.projectlombok:lombok:1.16.18"
    compile "org.springframework:spring-web:5.0.2.RELEASE"
    compile "org.springframework.retry:spring-retry:1.2.2.RELEASE"
    compile "com.fasterxml.jackson.core:jackson-databind:2.9.3"
    compile "org.kordamp.ikonli:ikonli-javafx:2.1.0"
    compile "org.kordamp.ikonli:ikonli-fontawesome5-pack:2.1.1"
    compile "net.harawata:appdirs:1.0.1"
    compile "io.sentry:sentry:1.6.4"
    compile "org.javassist:javassist:3.22.0-CR2"
    testCompile "junit:junit:4.12"
}

I tried adding

compile "net.java.dev.jna:jna-platform:4.5.1"

to that list but I'm still getting the same error when trying to build the installer.

Adding it to my buildscript dependencies did not change the error either:

buildscript {
    repositories {
        mavenCentral()
        jcenter()
    }
    dependencies {
        classpath "de.dynamicfiles.projects.gradle.plugins:javafx-gradle-plugin:8.8.2"
        classpath "com.github.ben-manes:gradle-versions-plugin:0.17.0"
        classpath "de.dynamicfiles.projects.javafx.bundler:custom-file-extension-windows-bundler:1.0.2-SNAPSHOT"
        classpath "net.java.dev.jna:jna-platform:4.5.1"
    }
}


Solution 1:[1]

Maintainer of the javafx-maven-plugin/Author of the javafx-gradle-plugin here!

Even if this is a very old post, and I did not see this one before (sorry), I might have an answer to this issue. And it happens even today.

While debugging an issue on the plugin (https://github.com/javafx-maven-plugin/javafx-maven-plugin/issues/395) I found that sometimes there are 2 files missing inside the JDK itself.

In case someone has installed any non-Oracle JDK, e.g. OpenLogic, the provided files are incomplete.

The JDK provided by OpenLogic (other others) provides a file called ant-javafx.jar, where all the system native files are contained (can be found inside the installed JDK in the lib-folder). That file is missing the required runtime files, that are required by the launcher.

Here a screenshot of what it looks like with OracleJDK:

content of Oracle JDK file

Here a screenshot of what it looks with OpenLogic JDK:

content of OpenLogic JDK

As you can see, there are files missing in there, which makes that JDK not equivalent to the OracleJDK sadly.

On maven-plugin level I can not do anything here to fix this, but you might be able to fix that by modifying that JAR-file by adding the missing files. You should be able to find them on your local windows installation at C:\Windows\System32\vcruntime140.dll or C:\Windows\System32\msvcp140.dll. If these files are missing, you just can download a official runtime installer of these Visual C++ Redistributable files here:

Another alternative would be to install a different OpenJDK, for example ojdkbuild (https://github.com/ojdkbuild/ojdkbuild). Using chocolatey on Windows just makes this a one-liner choco install ojdkbuild8 and does contain these required files.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 FibreFoX