title: Shadow jar missing common java classes
body: <p>I'm packaging a shadow jar of my app. The app uses kotlin and some external dependencies. All dependencies are in my jar but i get the following exception during runtime:</p>
  <blockquote>
  <p>java.lang.NoSuchMethodError: java.util.Optional.isEmpty()Z</p>
  </blockquote>
  <p>The Z at the end is always there; I don't where it comes from.</p>
  <p>I checked multiple example of build.gradle files and mine seems to be good.</p>
  <pre><code>buildscript {
      repositories {
          jcenter()
      }
      dependencies {
          classpath 'com.github.jengelman.gradle.plugins:shadow:6.1.0'
      }
  }
  
  plugins {
      id 'org.jetbrains.kotlin.jvm' version '1.3.72'
      id 'com.github.johnrengelman.shadow' version '6.1.0'
  }
  
  group 'com.bancarelvalentin'
  apply plugin: 'com.github.johnrengelman.shadow'
  apply plugin: 'kotlin'
  apply plugin: 'java'
  
  
  repositories {
      mavenCentral()
  }
  
  dependencies {
      implementation &quot;org.jetbrains.kotlin:kotlin-stdlib&quot;
      implementation &quot;com.discord4j:discord4j-core:3.1.0&quot;
      implementation &quot;com.natpryce:konfig:1.6.10.0&quot;
      implementation &quot;org.json:json:20200518&quot;
      implementation &quot;ch.qos.logback:logback-classic:1.2.3&quot;
      implementation &quot;org.slf4j:slf4j-api:1.7.30&quot;
  
  }
  
  shadowJar {
      archiveBaseName.set('DreamBot')
      archiveClassifier.set('')
      archiveVersion.set('0.0.0')
      mergeServiceFiles()
      manifest {
          attributes 'Main-Class': 'com.bancarelvalentin.dreambot.Main'
      }
  }
  </code></pre>
  <p>I have trouble identifying the exact problem is it my java install that is not working properly or is it my jar missing stuff ?</p>
  <p>Thanks for your help !</p>