Im trying to run my springboot project with gradle with the gradle bootRun command. However I get the error below :
* Executing task: gradle: bootRun
Task :compileJava FAILED
1 actionable task: 1 executed
<-------------> 0% WAITING
IDLE
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
java.io.IOException: Unable to delete directory 'C:\Users\victo\OneDrive\Desktop\expense_tracker\expense_tracker_backend\build\classes\java\main'
Failed to delete some children. This might happen because a process has files open or has its working directory set in the target directory.
- C:\Users\victo\OneDrive\Desktop\expense_tracker\expense_tracker_backend\build\classes\java\main\com\expense_tracker_backend
- C:\Users\victo\OneDrive\Desktop\expense_tracker\expense_tracker_backend\build\classes\java\main\com
However I dont think I have been running anything else. Im new to springboot so any help will be appreciated Im using gradle 8.12.1 and using java openjdk version "21" 2023-09-19
Ive tried closing file explorer, closing any other open terminals, paused OneDrive saving, closed any java stuff running with taskkill /F /IM java.exe
, and I have also made sure to stop any gradle daemons running. I expected this to make sure that no other processes would have files open. I have been running gradle runBoo
t through the vs code gradle extension. At this point I dont know what else might be causing this issue. If you need any more information let me know and Ill do my best to answer in a timely fashion
Im trying to run my springboot project with gradle with the gradle bootRun command. However I get the error below :
* Executing task: gradle: bootRun
Task :compileJava FAILED
1 actionable task: 1 executed
<-------------> 0% WAITING
IDLE
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
java.io.IOException: Unable to delete directory 'C:\Users\victo\OneDrive\Desktop\expense_tracker\expense_tracker_backend\build\classes\java\main'
Failed to delete some children. This might happen because a process has files open or has its working directory set in the target directory.
- C:\Users\victo\OneDrive\Desktop\expense_tracker\expense_tracker_backend\build\classes\java\main\com\expense_tracker_backend
- C:\Users\victo\OneDrive\Desktop\expense_tracker\expense_tracker_backend\build\classes\java\main\com
However I dont think I have been running anything else. Im new to springboot so any help will be appreciated Im using gradle 8.12.1 and using java openjdk version "21" 2023-09-19
Ive tried closing file explorer, closing any other open terminals, paused OneDrive saving, closed any java stuff running with taskkill /F /IM java.exe
, and I have also made sure to stop any gradle daemons running. I expected this to make sure that no other processes would have files open. I have been running gradle runBoo
t through the vs code gradle extension. At this point I dont know what else might be causing this issue. If you need any more information let me know and Ill do my best to answer in a timely fashion
1 Answer
Reset to default 0Verify Running Processes: Double-check that no other applications or processes are using files in the directory C:\Users\victo\OneDrive\Desktop\expense_tracker\expense_tracker_backend\build\classes\java\main. Sometimes files can remain locked by applications running in the background.
Restart Your Computer: Occasionally, a restart can help clear out any lingering processes that might be holding onto files or directories.
Exclude Build Directories from Antivirus Scans: Sometimes antivirus software can lock files temporarily while scanning them. Try excluding your project's build directories from real-time scans.
Gradle Clean Task: Before running bootRun again, try running gradle clean to clean up any previously compiled files and directories.
Check IDE and Terminal: Ensure that no terminals or IDE instances are still holding onto files in the build directory. Close and reopen them if necessary.
File Permissions: Ensure that your user account has sufficient permissions to delete files in the build directory.