最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

java - IOException Unable to Delete Directory on gradle bootRun for springboot when trying to run springboot project - Stack Ove

programmeradmin3浏览0评论

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 runBoot 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 runBoot 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

Share Improve this question edited Feb 7 at 9:20 M. Deinum 125k22 gold badges230 silver badges246 bronze badges asked Feb 7 at 3:55 Victor JimenezVictor Jimenez 11 bronze badge New contributor Victor Jimenez is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
Add a comment  | 

1 Answer 1

Reset to default 0

Verify 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.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论