# How can I configure Main Class in multimodules

**URL:** <https://discuss.gradle.org/t/how-can-i-configure-main-class-in-multimodules/36638>\
**Category:** Help/Discuss\
**Created:** [June 24, 2020, 1:04am UTC](https://discuss.gradle.org/t/how-can-i-configure-main-class-in-multimodules/36638 "2020-06-24T01:04:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Danachury](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/danachury/32/8646_2.png) [@Danachury](https://discuss.gradle.org/u/Danachury)\
**Post date:** [June 24, 2020, 1:04am UTC](https://discuss.gradle.org/t/how-can-i-configure-main-class-in-multimodules/36638/1 "2020-06-24T01:04:26Z")

</div>

Hi there, I new using Gradle,

I’m building a project with next technologies:  
Java  
Gradle  
Akka Http

**My project structure:**  
Root project ‘chatting-auth’  
±-- Project ‘:common’  
±-- Project ‘:data-connect’  
±-- Project ‘:domain’  
-– Project ‘:endpoint’

**build.gradle**

plugins {  
id ‘java’  
id ‘application’  
id ‘io.swagger.core.v3.swagger-gradle-plugin’ version ‘2.1.2’  
}

allprojects {  
group = ‘com.dac.chatting’  
version = ‘1.0-SNAPSHOT’  
sourceCompatibility = ‘14.0.1’  
targetCompatibility = ‘14.0.1’

```
sourceSets {
    main.java.srcDirs = ['src']
}

```

}

mainClassName = ‘com.dac.chatting.App’

subprojects {

```
apply plugin: 'java'

repositories {
    mavenCentral()
    mavenLocal()
    jcenter()
}

dependencies {
    implementation 'com.google.inject:guice:4.2.3'
    implementation 'com.typesafe.akka:akka-http_2.13:10.1.12'
    implementation 'com.typesafe.akka:akka-stream_2.13:2.6.6'
    implementation 'com.typesafe.akka:akka-slf4j_2.13:2.6.6'

    compileOnly 'org.projectlombok:lombok:1.18.12'
    compileOnly 'javax.ws.rs:javax.ws.rs-api:2.1.1'
    compileOnly 'org.apache.commons:commons-lang3:3.10'

    testImplementation 'org.testng:testng:7.1.0'

    annotationProcessor 'org.projectlombok:lombok:1.18.8'
}

```

}

**Error:**

> Task :run FAILED  
> Error: Could not find or load main class endpoint:com.dac.chatting.App  
> Caused by: java.lang.ClassNotFoundException: endpoint:com.dac.chatting.App

FAILURE: Build failed with an exception.

- What went wrong:  
Execution failed for task ‘:run’.

> Process ‘command ‘/usr/lib/jvm/java-14-oracle/bin/java’’ finished with non-zero exit value 1

- Try:  
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

- Get more help at [https://help.gradle.org](https://help.gradle.org)

BUILD FAILED in 678ms  
1 actionable task: 1 executed

But, the class already Exists, in **endpoint** module:  
 ![image](https://global.discourse-cdn.com/gradle/original/2X/5/5c0d2fb6cf2612eb0be8f163b332d519d6f1a209.png)

`What I am missing in the configuration?`

Thank you so much in advantage,

Denilson
