小编Jon*_*nes的帖子

IntelliJ 无法为 org.gradle.api.Project 类型的根项目“Blue Bot”设置未知属性“mainClassName”

我正在按照教程制作一个基本的 Discord Bot,(https://medium.com/discord-bots/making-a-basic-discord-bot-with-java-834949008c2b)我得到了错误,无法设置org.gradle.api.Project 类型的根项目“Blue Bot”的未知属性“mainClassName”,我不知道如何修复它。这是我的build.grade代码

plugins {
    id 'java'
}
mainClassName = "Main"
group 'BlueBot'
version '1.0-SNAPSHOT'

sourceCompatibility = 1.8

repositories {
    mavenCentral()
    jcenter()
}

dependencies {
    testCompile group: 'junit', name: 'junit', version: '4.12'
    compile 'net.dv8tion:JDA:4.0.0_62'
}
Run Code Online (Sandbox Code Playgroud)

这是我的Main.java代码

import net.dv8tion.jda.api.AccountType;
import net.dv8tion.jda.api.JDABuilder;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import net.dv8tion.jda.api.hooks.ListenerAdapter;

import javax.security.auth.login.LoginException;


public class Main extends ListenerAdapter {
    public static void main(String[] args) throws LoginException {
        JDABuilder builder = new JDABuilder(AccountType.BOT);
        String token = "enter token …
Run Code Online (Sandbox Code Playgroud)

gradle

1
推荐指数
1
解决办法
670
查看次数

标签 统计

gradle ×1