Java error with deleted files
已回答
Hi,
I've deleted some of my files using intellij, however it happens very often that after a change in a class and a new project compilation, i have this kind of error :
java: error: error reading /home/quentin/intellij/...admin/impl/ShowcaseAdminService.java; /home/quentin/intellij/...admin/impl/ShowcaseAdminService.java (No such file or directory)
Obviously intellij try to access the files I have deleted, and it fails since they don't exist anymore.
The only way I found to fix it is to rebuild the index, but it takes some times, and the error happen again and again after that, randomly.
How can I clear all intellij cache to fix this problem ?
Thanks
请先登录再写评论。
Hi Quentin,
How do you rebuild the index? Main meu | file | invalidate caches? Please provide information about your java and IJ versions and idea.log (main menu | help | reveal log).
Denis
Yep i do it using Main meu | file | invalidate caches
Using javac 1.6.0_38 to compile java sources, idea 129.161
Logs are attached. I restart intellij, the compilation works fine and show me some errors, I fix some of the errors, try to rebuild and then I get all the errors on all the files I deleted
java: error: error reading /home/quentin/intellij/...portal/persistence/company/business/hibernate/BusinessSkillDao.java; /home/quentin/intellij/...portal/persistence/company/business/hibernate/BusinessSkillDao.java (No such file or directory)
java: error: error reading /home/quentin/intellij/...portal/presentation/universe/buyer/AbstractBuyerUniverseCRUDPage.java; /home/quentin/intellij/...portal/presentation/universe/buyer/AbstractBuyerUniverseCRUDPage.java (No such file or directory)
java: error: error reading /home/quentin/intellij/...portal/persistence/company/business/IMyBusinessIndustryDao.java; /home/quentin/intellij/...portal/persistence/company/business/IMyBusinessIndustryDao.java (No such file or directory)
PS : rebuild Project make it works again, for some times, and then I get the same error again.
.....
Attachment(s):
log.zip
I see that your idea.log is full of records like 'error in opening zip file: /home/quentin/.m2/repository/com/thoughtworks/xstream/xstream/1.3/xstream-1.3-sources.jar'. Could you check if that jars with sources are valid (try to open them by archive manager/unpack their contents).
Denis
Hi Quentin,
Could you please change the following line in build-log.xml
<priority value="info" />
into
then delete build.log file and try to replicate the problem. Then please send me detailed build.log.
Best regards,
Eugene.
Hi,
Indeed the sources jars was corrupted, I guess maven fucked up.
I removed all of the sources jar and "rebuild Project". I didn't get the error so far. I'll let you know if it happens again and send you the logs as requested.
For posterity, I had a very similar issue with my Maven integration with IntelliJ. I deleted all the jars as stated above and the issue persisted. Following quentin ambard's bread crumbs I ended up reading through all the .xml files. Sure enough, the Class I deleted that had contained a main method for testing in a previous build ended up in one of my version records for configuration. I removed, in my case, the workspace.xml file in the IDEA folder (C:\Users\{MyUserName}\IdeaProjects\com.findingvirtual.data_stripper\.idea). After doing this, running clean in the Maven tool, and Invalidating Cache in IntelliJ IDEA, I ran Rebuild Project, and it works now. The problem was a Maven configuration issue.