Skip to content

Commit db8c97a

Browse files
committed
Add MacOS specific documentation, closes #23
1 parent 7771a40 commit db8c97a

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

README.md

+9-4
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,26 @@ public class HelloWorld {
5050
}
5151
```
5252

53-
## Build
54-
`make gen`
53+
## Build and run
54+
`./gradlew generate` or `make gen`
5555
Compiles and runs the code generator. This will generate Java code from [GIR](https://gi.readthedocs.io/en/latest/) files.
56+
5657
- Input: `generator/src/resources/gir/*`
5758
- Output Java: `java-gtk/build/generated/src/main/java/[...]/*.java`
5859
- Configuration: [generator/src/main/kotlin/ch/bailu/gtk/Configuration.kt](generator/src/main/kotlin/ch/bailu/gtk/Configuration.kt)
5960

60-
`make`
61+
`./gradlew build` or `make`
6162
Creates library, javadoc and run tests
63+
6264
- Output: jar, javadoc.jar and sources.jar in `libray/build/libs/`
6365

64-
`make run`
66+
`./gradlew run` or `make run`
6567
Run the default demo application.
6668
There are more demo applications in [examples/src/main/java/examples](examples/src/main/java/examples) including GeoClue2 and Adwaita samples.
6769

70+
- To run on Windows see [doc/windows.md](doc/windows.md)
71+
- To run on MacOS see [doc/macos.md](doc/macos.md)
72+
6873
`make install`
6974
Compile Java library, generate JAR archive and copy JAR archive as artifact to local Maven repository (`~/.m2/repository`).
7075

doc/macos.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Using java-gtk on MacOS
2+
3+
## Install GTK libraries
4+
5+
[Setting up GTK for Mac OS ](https://www.gtk.org/docs/installations/macos/)
6+
7+
## Running a java-gtk application
8+
9+
On MacOS the main thread of a java-gtk application needs to be thread 0.
10+
In order to start the application on the correct thread the option `-XstartOnFirstThread` needs to be passed to the JVM
11+
12+
Example: `./gradlew run -Dorg.gradle.jvmargs="-XstartOnFirstThread"`

0 commit comments

Comments
 (0)