title: Kotlin Gradle Could not find or load main class
body: <p>I tried to copy the <strong>Spring Boot Kotlin</strong> sample project <a href="https://github.com/JetBrains/kotlin-examples/tree/master/tutorials/spring-boot-restful" rel="nofollow noreferrer">https://github.com/JetBrains/kotlin-examples/tree/master/tutorials/spring-boot-restful</a>. I Added some more dependencies and when I tried to build the executable jar and run it, I got the error:</p>
  <blockquote>
  <p>Could not find or load main class...</p>
  </blockquote>
  <p><em>Gradle build script</em>:</p>
  <pre><code>buildscript {
      ext.kotlin_version = '1.1.3' // Required for Kotlin integration
      ext.spring_boot_version = '1.5.4.RELEASE'
      repositories {
          jcenter()
      }
      dependencies {
          classpath &quot;org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version&quot; // Required for Kotlin integration
          classpath &quot;org.jetbrains.kotlin:kotlin-allopen:$kotlin_version&quot; // See https://kotlinlang.org/docs/reference/compiler-plugins.html#kotlin-spring-compiler-plugin
          classpath &quot;org.springframework.boot:spring-boot-gradle-plugin:$spring_boot_version&quot;
      }
  }
  
  /*plugins {
      id 'org.springframework.boot' version '2.0.0.RELEASE'
  }*/
  
  apply plugin: 'kotlin' // Required for Kotlin integration
  apply plugin: &quot;kotlin-spring&quot; // See https://kotlinlang.org/docs/reference/compiler-plugins.html#kotlin-spring-compiler-plugin
  apply plugin: 'org.springframework.boot'
  
  jar {
      baseName = 'gs-rest-service'
      version = '0.1.0'
      from {
          (configurations.runtime).collect {
              it.isDirectory() ? it : zipTree(it)
          }
      }
      manifest {
          attributes 'Main-Class': 'org.jetbrains.kotlin.demo.Applicationkt'
      }
  
  
  }
  
  sourceSets {
      main.java.srcDirs += 'src/main/kotlin/'
      test.java.srcDirs += 'src/test/kotlin/'
  }
  
  repositories {
      jcenter()
  }
  
  dependencies {
      compile &quot;org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version&quot; // Required for Kotlin integration
      compile(&quot;org.springframework.boot:spring-boot-starter-web&quot;)
  
      compile group: 'org.apache.camel', name: 'camel-quartz2', version: '2.20.2'
      compile group: 'org.apache.camel', name: 'camel-http4', version: '2.20.2'
      compile group: 'org.apache.camel', name: 'camel-docker', version: '2.20.2'
      compile group: 'org.apache.camel', name: 'camel-aws', version: '2.20.2'
  
      testCompile('org.springframework.boot:spring-boot-starter-test')
  }
  </code></pre>