Skip to content

Commit 3365cf2

Browse files
committed
Fix documentation about module-info.java
1 parent 2f189b8 commit 3365cf2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/register.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ When instantiating a new Java instance of the class, the call to `super()` will
3737
!!! info
3838
In Java-GI version 0.11.* and below, the GType must be explicitly registered with a call to `Types.register(classname.class)`, and the constructor must be a static factory method. Since Java-GI 0.12.0, this is not necessary anymore.
3939

40-
If your Java application is module-based, you must export your package to the `org.gnome.gobject` module in your `module-info.java` file, to allow the reflection to work:
40+
If your Java application is module-based, you must "open" your package to the `org.gnome.glib` module in your `module-info.java` file, to allow the reflection to work:
4141

4242
```
4343
module my.module.name {
44-
exports my.package.name to org.gnome.gobject;
44+
opens my.package.name to org.gnome.glib;
4545
}
4646
```
4747

docs/templates.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ A class with a `@GtkTemplate` annotation will be registered as a Gtk composite t
4444

4545
In the above class, the `header_bar` and `label` fields and the `buttonClicked` callback function are all declared the UI file. During class initialization, the fields are set to the associated widget.
4646

47-
Because the registration of composite template classes uses reflection, you must add the following `exports` statement to your `module-info.java` file:
47+
If you use Java modules (with a `module-info.java`), add the following `opens` statement to `module-info.java` to allow Java-GI's reflection to work:
4848

4949
```
5050
module my.module.name {
51-
exports my.package.name to org.gnome.gobject,org.gnome.gtk;
51+
opens my.package.name to org.gnome.glib,org.gnome.gtk;
5252
}
5353
```
5454

0 commit comments

Comments
 (0)