-
Notifications
You must be signed in to change notification settings - Fork 350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.lang.UnsatisfiedLinkError: URI scheme is not "file" with javafx:jlink #394
Comments
See the thread on stackoverflow for more info about the error and temporary fix. |
You need to implement your own |
If you want me to look into this further, please provide a project (preferably Jetbrains Idea) where I can duplicate this issue. |
You can find the actual project that produces the error in github. Could you give docs about how to implement |
Fixed with the following code package com.github.srilakshmikanthanp.facsimile.locator;
import java.io.File;
import java.util.ArrayList;
import java.util.Iterator;
import com.github.kwhat.jnativehook.NativeLibraryLocator;
import com.github.kwhat.jnativehook.NativeSystem;
/**
* This class is used to locate the native libraries.
*/
public class JLibLocator implements NativeLibraryLocator {
/**
* This method is used to regsiter the Locator.
*/
public static void setAaDefaultLocator() {
System.setProperty("jnativehook.lib.locator", JLibLocator.class.getCanonicalName());
}
/**
* Locates the native libraries.
*/
@Override
public Iterator<File> getLibraries() {
var libs = new ArrayList<File>(1);
var os = NativeSystem.getFamily().toString().toLowerCase();
var arch = NativeSystem.getArchitecture().toString().toLowerCase();
var jhome = System.getProperty("java.home");
var libName = System.mapLibraryName("JNativeHook");
var lib = jhome + File.separator + os + File.separator + arch + File.separator + libName;
var libFile = new File(lib);
libs.add(libFile);
return libs.iterator();
}
} And make sure that you manually copied the dill files so image folder looks like ├───bin
│ └───server
├───conf
│ └───security
│ └───policy
│ ├───limited
│ └───unlimited
├───darwin
│ ├───arm64
│ └───x86_64
├───include
│ └───win32
├───legal
│ ├───java.base
│ ├───java.datatransfer
│ ├───java.desktop
│ ├───java.logging
│ ├───java.prefs
│ ├───java.xml
│ └───jdk.unsupported
├───lib
│ └───security
├───linux
│ ├───arm
│ ├───arm64
│ ├───x86
│ └───x86_64
└───windows
├───arm
├───x86
└───x86_64 |
can we close this issue ? |
这里要从两点去解决: 思路: build.gradle代码
自定义的 NativeLibraryLocator
|
Hello i am using this library with javafx running with
mvn javafx:run
works fine but withmvn javafx:jlink
fails to start with a launcher, here is javafx plugin xml,and Here is stake trace,
The text was updated successfully, but these errors were encountered: