Maven doesn't compile the project with jNativeHook from Github

231 views Asked by At

I have added Jitpack repo and dependency from Github to pom.xml and it still doesn't compile. However, when I point onto the line in import block, it clearly shows the description of a module. VSCode screenshot

For example, I try to import com.github.kwhat.jnativehook.GlobalScreen, it shows the description of the module but still underlines the line with red and shows the error:

The type com.github.kwhat.jnativehook.GlobalScreen is not accessible Java(16778666)

What could be the problem?

Here's a part of pom.xml

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-controls</artifactId>
        <version>13</version>
    </dependency>
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-fxml</artifactId>
        <version>13</version>
    </dependency>
    <dependency>
        <groupId>com.github.kwhat</groupId>
        <artifactId>jnativehook</artifactId>
        <version>2.2.1</version>
    </dependency>
    
</dependencies>
1

There are 1 answers

1
Mihai8 On

Just try to synchronize you project.

I add an imagine where can be seen that dependencies is load correctly.enter image description here.