Gradle项目在IDEA中运行时提示:Unnecessarily replacing a task that does not exist is not supported. Use create

目录
场景
在IDEA中新建Gradle项目后,使用Java语言。
新建类后添加main方法,然后运行main方法释提示:
|
|
实现
这是因为在运行main方法时,gradle并没有识别,将其认为是一个task。
来到项目下的.idea下的gradle.xml文件
将下面的设置改为false
|
|
如果没有则添加该配置。