简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM