簡體   English   中英

Intellij無法編譯Gradle項目

[英]Intellij could not compile gradle project

我是Gradle構建系統的新手。 我想在IntelliJ IDEA 2016.1 Community Edition中使用gradle。

  • 我使用向導創建了gradle項目。
  • 創建了一個簡單的javafx應用程序
  • 我嘗試建立專案並發生錯誤

錯誤:gradle-resources-test:aMaze_test:java.lang.NoClassDefFoundError:org / apache / tools / ant / util / ReaderInputStream

的build.gradle

group 'aryanware'
version '1.0-SNAPSHOT'

apply plugin: 'java'

sourceCompatibility = 1.5

repositories {
    mavenCentral()
}

dependencies {
    testCompile group: 'junit', name: 'junit', version: '4.11'
}

AmazeWindow.java

package aryanware.amaze;

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.stage.Stage;

public class AmazeWindow extends Application {
    @Override
    public void start(Stage primaryStage) {
        Group root = new Group();
        Scene scene = new Scene(root, 300, 250);

        primaryStage.setTitle("Hello World!");
        primaryStage.setScene(scene);
        primaryStage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}

項目結構

項目結構

我對gradle的工作原理並不了解。 因此,我無法自行解決此錯誤。

我已經在論壇和接縫中將其檢查為Intellij問題。 建議的解決方法是使緩存無效。

IntelliJ /無效緩存

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM