title: A JNI error has occurred, please check your installation and try again
body: <p>I'm trying to deploy java-SpringBoot project (Building a messenger bot) into </p>
  
  <p>heroku, but when i try to use : 
  heroku local
  command, i get this Error: </p>
  
  <pre><code>Error: A JNI error has occurred, please check your 
  installation and try again
  Exception in thread "main" 
  
  
  java.lang.NoClassDefFoundError:
  com/github/messenger4j/send/MessengerSendClient
  at java.lang.Class.getDeclaredMethods0(Native Method)
  at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
  at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
  at java.lang.Class.getMethod0(Class.java:3018)
  at java.lang.Class.getMethod(Class.java:1784)
  at 
  sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
  at 
  sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
  Caused by: java.lang.ClassNotFoundException: 
  com.github.messenger4j.send.MessengerSendClient
  at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:357)... 7 more
  </code></pre>
  
  <p>My Procfile look like this : </p>
  
  <pre><code>web: java $JAVA_OPTS -cp target/classes:target/dependency/* me.messengerBot.SpringDocBotApplication
  </code></pre>
  
  <p>My main class:</p>
  
  <pre><code>@SpringBootApplication
  public class SpringDocBotApplication {
  
  private static final Logger logger = LoggerFactory.getLogger(SpringDocBotApplication.class);
  
  /**
   * Initializes the {@code MessengerSendClient}.
   *
   * @param pageAccessToken the generated {@code Page Access Token}
   */
  @Bean
  public MessengerSendClient 
  messengerSendClient(@Value("${messenger4j.pageAccessToken}")
  String pageAccessToken) {
      logger.debug("Initializing MessengerSendClient - pageAccessToken: {}", pageAccessToken);
      return MessengerPlatform.newSendClientBuilder(pageAccessToken).build();
  }
  
  public static void main(String[] args) {
      SpringApplication.run(SpringDocBotApplication.class, args);
  }
  </code></pre>
  
  <p>}</p>
  
  <p>My configuration my is application.yml and it holds the authentication values.</p>
  
  <p>My pom file  : </p>
  
  <p>dependencies and plugin only: </p>
  
  <pre><code>&lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.github.messenger4j&lt;/groupId&gt;
          &lt;artifactId&gt;messenger4j&lt;/artifactId&gt;
          &lt;version&gt;0.8.0&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.jsoup&lt;/groupId&gt;
          &lt;artifactId&gt;jsoup&lt;/artifactId&gt;
          &lt;version&gt;1.10.2&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
          &lt;/plugin&gt;
  
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;version&gt;3.3&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;source&gt;1.8&lt;/source&gt;
                  &lt;target&gt;1.8&lt;/target&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
  
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p>There are so many different answers to java java.lang.ClassNotFoundException/NoClassDefFoundError and i've tried it all.</p>
  
  <p>I believe it's a java classpath issue (because it run from command line) but all suggestion online don't work for me.</p>