Tung Vo
Tung Vo

Reputation: 2549

Could not set unknown property 'applicationDefaultJvmArgs' in Gradle

In file build.gradle of my Java project i add applicationDefaultJvmArgs as bellow

applicationDefaultJvmArgs = ['-Xmx512m', '-XX:MaxPermSize=512m', '-Dinm.testmode=true', '-Dfile.encoding=UTF-8', '-Xdebug','-Xrunjdwp:transport=dt_socket,server=y,address=7979,suspend=n']

and i get error

Could not set unknown property 'applicationDefaultJvmArgs' for root project

How can i fix it ?

Upvotes: 2

Views: 3536

Answers (1)

Thomas K.
Thomas K.

Reputation: 6770

applicationDefaultJvmArgs is a property of the Application Plugin and must be defined in the application configuration closure:

plugins {
    id 'application'
}

application {
    applicationDefaultJvmArgs = ['-Xmx512m', '-XX:MaxPermSize=512m', '-Dinm.testmode=true', '-Dfile.encoding=UTF-8', '-Xdebug','-Xrunjdwp:transport=dt_socket,server=y,address=7979,suspend=n']
}

See the application plugin's Usage guide for more examples.

Upvotes: 4

Related Questions