指定的初始化脚本'/tmp/ijresolvers.gradle'不存在

a_s*_*ber 5 java intellij-idea spring-boot

Linux 薄荷 20.1

在 IntelIJ 2020 中,我导入 SpringBoot gradle 项目。

这是我的 build.gradle

plugins {
    id 'org.springframework.boot' version '2.4.2'
    id 'io.spring.dependency-management' version '1.0.11.RELEASE'
    id 'java'
}

group = 'com.gmail.myproject
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'

repositories {
    mavenCentral()
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

test {
    useJUnitPlatform()
}
Run Code Online (Sandbox Code Playgroud)

从终端我成功运行 spring boot 项目:

./gradlew bootrun
Run Code Online (Sandbox Code Playgroud)

好的。

现在我想从 IntelIJ 运行项目。但我收到错误:

11:23:24 AM: Executing task...


FAILURE: Build failed with an exception.

* What went wrong:
The specified initialization script '/tmp/ijresolvers.gradle' does not exist.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 10ms
11:23:24 AM: Task execution finished.
Run Code Online (Sandbox Code Playgroud)

R0b*_*b1n 7

删除/home/[YOUR_USERNAME]/.gradle对我有用的内容。


小智 4

我遇到了和你一样的问题,幸运的是,因为这是 /tmp/ 文件夹问题,你需要做的就是重新启动系统。我刚刚重新启动,问题就消失了。