Execution failed for task ':compileJava' whenever I try to build workspace.

Started by dapankakes on

Topic category: Troubleshooting, bugs, and solutions

Joined Feb 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Execution failed for task ':compileJava' whenever I try to build workspace.

Whenever I try to execute the build gradle task, this error always appears:

Executing Gradle task: build
Build info: MCreator 2024.4.52410, neoforge-1.21.1, 64-bit, 16299 MB, Windows 11, JVM 21.0.4, JAVA_HOME: C:\Users\richa\Downloads\MCreator.2024.4.Windows.64bit\MCreator20244\jdk, started on: 2025-02-01-17:54:21

Calculating task graph as no cached configuration is available for tasks: build
> Task :createArtifactManifest UP-TO-DATE
> Task :createMinecraftArtifacts UP-TO-DATE
> Task :jarJar NO-SOURCE
> Task :processTestResources NO-SOURCE
> Task :processResources UP-TO-DATE
> Task :compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> java.nio.file.AccessDeniedException: C:\Users\erict\MCreatorWorkspaces\pankakes_mod\build\moddev\artifacts\neoforge-21.1.65-minecraft.jar
* 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 2s
4 actionable tasks: 1 executed, 3 up-to-date
Configuration cache entry stored.

BUILD FAILED
Task completed in 2 seconds

 

I've tried to restart my computer and delete "C:\Users\erict\MCreatorWorkspaces\pankakes_mod\build" but, the result is said error. Does anyone have a fix for this? I'm also new to this sort of thing.