Where does SWT write DLL files on Windows?

I can not find on the Internet where SWT is trying to write DLL files. I have a computer where jar does not start just because SWT cannot write DLLs.

UPDATE 1

java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.sun.javaws.Launcher.executeApplication(Unknown Source) at com.sun.javaws.Launcher.executeMainClass(Unknown Source) at com.sun.javaws.Launcher.doLaunchApp(Unknown Source) at com.sun.javaws.Launcher.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: no swt-win32-3738 in java.library.path no swt-win32 in java.library.path Can't load library: \\ubz01fst\Students\User2010\Com\xxx\swt-win32-3738.dll Can't load library: \\ubz01fst\Students\User2010\Com\xxx\swt-win32.dll at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source) at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source) at org.eclipse.swt.internal.C.<clinit>(Unknown Source) at org.eclipse.swt.widgets.Display.<clinit>(Unknown Source) at install.Main.main(Main.java:162) 
+4
source share
2 answers

I myself find out the answer. Starting with SWT 3.3, you no longer need to include the native library (DLL) because they are located in the bank itself and they are unpacked as soon as the SWT library is called. DLL files are unpacked from the jar and placed in the ".swt" folder under your "System.getProperty (" user.home ")". In my case, the problem was that System.getProperty ("user.home") is set to "\ ubz01fst \ Students \ User2010 \ Com \ xxx", which is a UNC loop and not writable (this often happens in companies or computers organizations).

I do not know for what reason System.getProperty ("user.home") on computers is taken from the Windows environment variable "HOMESHARE"

The solution is to modify the System.getProperty ("user.home") with the ability to write, for example:

 System.setProperty("user.home", System.getenv("USERPROFILE")); 

before calling any SWT code.

+6
source

Ok, I found a solution. The problem was dll generation. I used version 3.7m5, I downloaded the previous version (3.7), and the application started correctly.

Sincerely.

-1
source

Source: https://habr.com/ru/post/1381545/


All Articles