Devs love ZenUML
Devs love ZenUML

Reputation: 11842

Could not set unknown property 'mainClassName' for root project

I am writing a spark application. With the following build.gradle file, I am getting an error as stated in the title when syncing gradle in Intellij Idea.

plugins {
  id 'java'
}

sourceCompatibility = 1.8

mainClassName = 'HelloSpark'

repositories {
  mavenCentral()
}

dependencies {
....
}

Upvotes: 19

Views: 14169

Answers (1)

Devs love ZenUML
Devs love ZenUML

Reputation: 11842

This is because the property mainClassName is introduced by the gradle plugin application. Adding the application plugin fixed the error:

plugins {
  id 'java'
  id 'application'
}

Upvotes: 42

Related Questions