[Solved] Groovy Project Compile Error: java.lang.NoClassDefFoundError: org/apache/tools/ant/util/ReaderInputStream

1. Error Messages:

Clearing build system data...
Executing pre-compile tasks...
Loading Ant configuration...
Running Ant tasks...
Cleaning output directories...
Running 'before' tasks
Checking sources
Finished, saving caches...
gradle-resources-test:Groovy_Demo.main: java.lang.NoClassDefFoundError: org/apache/tools/ant/util/ReaderInputStream
Executing post-compile tasks...
Loading Ant configuration...
Running Ant tasks...
Synchronizing output directories...
2022/1/10 11:08 - Build completed with 1 error and 0 warnings in 1 sec, 657 ms

在这里插入图片描述

2. Solution

Right-click the project root directory, select the “Open Module Settings” option,

insert image description here

Delete the main and test options in Modules,

insert image description here

Then select the menu bar “Build / Rebuild Project” option to recompile the project;

insert image description here

The project compiles through ;

insert image description here

Read More:

Leave a Reply

Your email address will not be published. Required fields are marked *