title: JavaFX not finding custom module
body: <p>I am making a simple Telegram bot with my own custom library in JavaFX with OpenJDK 11. The project was built as a JavaFX project from IntelliJ IDEA, with Gradle as build system. The library consists of a single class (Telegram) with a single function to send a message, and uses the JTeleBot library (<a href="https://github.com/shibme/jtelebot" rel="nofollow noreferrer">https://github.com/shibme/jtelebot</a>). I do NOT have JavaFX installed, I am instead using the IntelliJ default JavaFX libraries, which has been working fine until now for previous projects. The program opens properly before including the custom library, but as soon as I include it, it gives the following error:</p>
  <pre><code>Error occurred during initialization of boot layer
  java.lang.module.FindException: Module Telegram not found, required by my.group.project_telegram
  </code></pre>
  <p>Does anybody have any idea on how to fix this? <code>require Telegram</code> is included in the <code>module-info.java</code> file. I have also tried remaking the project from scratch, with no results. Here are some of my project files:</p>
  <p>build.gradle:</p>
  <pre><code>    plugins {
      id 'java'
      id 'application'
      id 'org.openjfx.javafxplugin' version '0.0.10'
      id 'org.beryx.jlink' version '2.24.1'
  }
  
  group 'my.group'
  version '1.0'
  
  repositories {
      mavenCentral()
      maven {
          url &quot;https://gitlab.com/api/v4/projects/&lt;project-id&gt;/packages/maven&quot;
          credentials(HttpHeaderCredentials) {
              name = &quot;Private-Token&quot;
              value = gitLabPrivateToken // the variable resides in ~/.gradle/gradle.properties
          }
          authentication {
              header(HttpHeaderAuthentication)
          }
      }
  }
  
  ext {
      junitVersion = '5.8.2'
  }
  
  sourceCompatibility = '11'
  targetCompatibility = '11'
  
  tasks.withType(JavaCompile) {
      options.encoding = 'UTF-8'
  }
  
  application {
      mainModule = 'my.group.project_telegram'
      mainClass = 'my.group.project_telegram.HelloApplication'
  }
  
  javafx {
      version = '11.0.2'
      modules = ['javafx.controls', 'javafx.fxml']
  }
  
  dependencies {
      implementation('my.group:Telegram:1.0')
      implementation('org.controlsfx:controlsfx:11.1.1')
      implementation('com.dlsc.formsfx:formsfx-core:11.5.0') {
          exclude(group: 'org.openjfx')
      }
  
      testImplementation(&quot;org.junit.jupiter:junit-jupiter-api:${junitVersion}&quot;)
      testRuntimeOnly(&quot;org.junit.jupiter:junit-jupiter-engine:${junitVersion}&quot;)
  }
  
  test {
      useJUnitPlatform()
  }
  
  jlink {
      imageZip = project.file(&quot;${buildDir}/distributions/app-${javafx.platform.classifier}.zip&quot;) as RegularFile
      options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
      launcher {
          name = 'app'
      }
  }
  
  jlinkZip {
      group = 'distribution'
  }
  </code></pre>
  <p>module-info.java:</p>
  <pre><code>module my.group.project_telegram {
      requires javafx.controls;
      requires javafx.fxml;
  
      requires org.controlsfx.controls;
      requires com.dlsc.formsfx;
      requires Telegram;
  
      opens my.group.project_telegram to javafx.fxml;
      exports my.group.project_telegram;
  }
  </code></pre>
  <p>The library:</p>
  <pre><code>package pkgTelegram;
  
  import me.shib.java.lib.telegram.bot.service.TelegramBot;
  import me.shib.java.lib.telegram.bot.types.*;
  
  import java.io.IOException;
  
  public class Telegram {
  
      public static void sendToTelegram(String apiToken, String chatId, String text) {
          // the function's code
      }
  }
  </code></pre>