# Main class name in MANIFEST file

**URL:** <https://discuss.kotlinlang.org/t/main-class-name-in-manifest-file/1880>\
**Category:** Uncategorized\
**Created:** [July 21, 2016, 2:30pm UTC](https://discuss.kotlinlang.org/t/main-class-name-in-manifest-file/1880 "2016-07-21T14:30:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![medium](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/medium/32/10404_2.png) [@medium](https://discuss.kotlinlang.org/u/medium)\
**Post date:** [July 21, 2016, 2:30pm UTC](https://discuss.kotlinlang.org/t/main-class-name-in-manifest-file/1880/1 "2016-07-21T14:30:23Z")

</div>

I’m trying to build a fat jar, but I don’t know what I should provide as ‘Main-Class’. The program consists of a Kotlin file, name “App.kt” with a single main method like this:

```auto
fun main(args: Array<String>) {
  println("hello, world!")
}

```

The Gradle build file looks like this:

```auto
group 'com.example'
version '1.0'

buildscript {
    ext.kotlin_version = '1.0.3'

    repositories {
        mavenCentral()
    }
    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

apply plugin: 'kotlin'

repositories {
    mavenCentral()
}

dependencies {
    compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}

task bigJar(type: Jar) {
    manifest {
        attributes 'Implementation-Title': 'Table of Contents Fix for Hugo',
                'Implementation-Version': version,
                'Main-Class': 'com.example.project.App'
    }
    baseName = project.name
    from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
    with jar
}

```

But if I try to execute the jar file, I get the error that the Main class “com.example.project.App” could not be found.

What is the correct main class name?

---

<div class="post-metadata">

**Author:** ![yole](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/yole/32/1425_2.png) [@yole](https://discuss.kotlinlang.org/u/yole)\
**Post date:** [July 21, 2016, 3:55pm UTC](https://discuss.kotlinlang.org/t/main-class-name-in-manifest-file/1880/2 "2016-07-21T15:55:04Z")

</div>

As documented [here](https://kotlinlang.org/docs/reference/java-to-kotlin-interop.html#package-level-functions) the main class name will be `AppKt`.

---

<div class="post-metadata">

**Author:** ![medium](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/medium/32/10404_2.png) [@medium](https://discuss.kotlinlang.org/u/medium)\
**Post date:** [July 21, 2016, 5:48pm UTC](https://discuss.kotlinlang.org/t/main-class-name-in-manifest-file/1880/3 "2016-07-21T17:48:41Z")

</div>

Thank you.
