简体   繁体   English

无法在 Gradle 中设置未知属性“applicationDefaultJvmArgs”

[英]Could not set unknown property 'applicationDefaultJvmArgs' in Gradle

In file build.gradle of my Java project i add applicationDefaultJvmArgs as bellow在我的 Java 项目的文件 build.gradle 中,我添加applicationDefaultJvmArgs如下

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: applicationDefaultJvmArgs应用程序插件的一个属性,必须在application配置闭包中定义:

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.有关更多示例,请参阅应用程序插件的使用指南。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Gradle:无法在 Intellij 中设置未知属性“classDumpFile” - Gradle: could not set unknown property 'classDumpFile' in Intellij 无法在Gradle中获得任务的未知属性? - Could not get unknown property for task in Gradle? 无法获取未知属性“运行时”Gradle 7.0 - Could not get unknown property "runtime" Gradle 7.0 无法为 org.springframework.boot.gradle.dsl.SpringBootExtension 类型的对象设置未知属性“mainClass” - Could not set unknown property 'mainClass' for object of type org.springframework.boot.gradle.dsl.SpringBootExtension 无法为 org.springframework.boot.gradle.dsl.SpringBootExtension 类型的扩展“springBoot”设置未知属性“mainClassName” - Could not set unknown property 'mainClassName' for extension 'springBoot' of type org.springframework.boot.gradle.dsl.SpringBootExtension 使用Gradle 5.4.1签名maven jar导致无法设置未知属性'keyId' - Signing maven jar with Gradle 5.4.1 results in Could not set unknown property 'keyId' 无法为扩展“应用程序”设置未知属性“mainClass” - Could not set unknown property 'mainClass' for extension 'application 无法为根项目设置未知属性“mainClassName” - Could not set unknown property 'mainClassName' for root project 无法为类型com.android.build.gradle.internal.api.DefaultAndroidSourceSet的源集主设置未知属性's' - Could not set unknown property 's' for source set main of type com.android.build.gradle.internal.api.DefaultAndroidSourceSet 无法为 org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler 类型的对象设置未知属性“nav_version” - Could not set unknown property 'nav_version' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM