Skip to content
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

Flatlaf 1.1 Windows flatlaf-windows-x86_64.dll not found #289

Closed
tumbare opened this issue Mar 28, 2021 · 7 comments
Closed

Flatlaf 1.1 Windows flatlaf-windows-x86_64.dll not found #289

tumbare opened this issue Mar 28, 2021 · 7 comments
Milestone

Comments

@tumbare
Copy link

tumbare commented Mar 28, 2021

Running my app on windows 10 after updating to version 1.1 and I get the following :

Mar. 29, 2021 12:35:33 AM com.formdev.flatlaf.util.LoggingFacadeImpl logSevere
SEVERE: Library 'com/formdev/flatlaf/natives/flatlaf-windows-x86_64.dll' not found

@DevCharly
Copy link
Collaborator

This message means that the DLL is not found in the classpath.

The DLL is usually in flatlaf.jar.
Is it possible that you repackaged content of flatflaf.jar into own application jar (fatJar or uberJar) and did not include the DLLs?

@tumbare
Copy link
Author

tumbare commented Mar 29, 2021

Thanks for the reply DevCharly , I used gradle to pull it in so I think manually adding the jar to my project should help resolve the issue . FYI the gradle directive I used compile group: 'com.formdev', name: 'flatlaf', version: '1.1'

@Chrriis
Copy link
Contributor

Chrriis commented Mar 30, 2021

I use the 1.1.1 JAR unmodified and I get the same error when I launch the program:

FlatLaf native not found

Note that I redefine "java.io.tmpdir" during my application startup, and "java.library.path" is defined as a VM argument.

@Chrriis
Copy link
Contributor

Chrriis commented Mar 30, 2021

This might be related to modules.

In NativeLibrary.loadLibraryFromJar(xx):
classLoader.getResource( libraryName ) => null

If I evaluate this:
NativeLibrary.class.getResource("/" + libraryName) => OK

@Chrriis
Copy link
Contributor

Chrriis commented Mar 30, 2021

As indicated in the answer of this Stack Overflow post:
https://stackoverflow.com/questions/45166757/loading-classes-and-resources-in-java-9

A final important difference is that non-class-file resources in a module are encapsulated by default, and hence cannot be located from outside the module unless their effective package is open. To load resources from your own module it’s best to use the resource-lookup methods in Class or Module, which can locate any resource in your module, rather than those in ClassLoader, which can only locate non-class-file resources in the open packages of a module.

@DevCharly
Copy link
Collaborator

Many, many thanks for the hint. I'll check this...

DevCharly added a commit that referenced this issue Apr 1, 2021
@DevCharly
Copy link
Collaborator

Fixed in main branch and available in latest snapshot:
https://github.com/JFormDesigner/FlatLaf#snapshots

@DevCharly DevCharly added this to the 1.1.2 milestone Apr 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants