1
- # Install GTK libraries
1
+ # Using java-gtk on Windows
2
+
3
+ ## Install GTK libraries
2
4
3
5
See [ Setting up GTK for Windows] ( https://www.gtk.org/docs/installations/windows )
4
6
@@ -11,7 +13,7 @@ pacman -S mingw-w64-x86_64-libadwaita
11
13
3 . Add ` C:\msys64\mingw64\bin ` to PATH
12
14
13
15
14
- # Build and run sample
16
+ ## Build and run sample
15
17
16
18
``` PowerShell
17
19
git clone https://github.com/bailuk/java-gtk.git
@@ -21,17 +23,17 @@ cd java-gtk
21
23
.\gradlew.bat run
22
24
```
23
25
24
- # Trouble shoot
26
+ ## Trouble shoot
25
27
26
- ## Alternative names
28
+ ### Alternative names
27
29
28
30
GTK for Windows has a different naming schema for libraries than assumed by default.
29
31
Default library names are configured in [ Configuration.kt] ( ../generator/src/main/kotlin/ch/bailu/gtk/Configuration.kt ) .
30
32
Alternative names are configured in [ loader.properties] ( ../java-gtk/src/main/resources/jna/loader.properties ) .
31
33
More alternative names can be added programmatically during runtime: [ Loader.java] ( ../java-gtk/src/main/java/ch/bailu/gtk/lib/jna/Loader.java ) .
32
34
33
35
34
- ## Windows library load order
36
+ ### Windows library load order
35
37
36
38
Windows library (dll) search paths:
37
39
- Current directory
@@ -40,29 +42,29 @@ Windows library (dll) search paths:
40
42
- Windows PATH variable
41
43
42
44
43
- ## Related and useful system properties (Java and JNA)
45
+ ### Related and useful system properties (Java and JNA)
44
46
45
47
``` Java
46
48
System . setProperty(" jna.debug_load" , " true" );
47
49
System . out. println(System . getProperty(" java.library.path" ));
48
50
System . out. println(System . getProperty(" jna.library.path" ));
49
51
```
50
52
51
- ## JNA library load order
53
+ ### JNA library load order
52
54
53
55
1 . ` java.library.path `
54
56
2 . ` jna.library.path `
55
57
3 . Resource path: JAR or ` build\classes\java\main `
56
58
57
- ## Dependencies
59
+ ### Dependencies
58
60
59
61
DLLs depend on other DLLs. In this case linking is done by the Windows OS and not by JNA.
60
62
To check dependencies, run ldd from WinGW Terminal: ` ldd library-to-check.dll `
61
63
62
64
DLLs loaded by JNA must be identical (same file, not a copy) with DLLs loaded by Windows.
63
65
64
66
65
- ## Naming
67
+ ### Naming
66
68
67
69
lib[ name] -[ major] -[ minor] .dll
68
70
0 commit comments