IDEA Recompile Failing with compile errors - No errors while viewing/editing file

已回答

In Debug mode , when I'm trying to "Compile And Reload File" to do a hotswap it is failing with compilation errors. Compilation errors are basic like package doesn't exist, Cannot find symbol class. But in the normal edit file , there are no compilation or syntax errors. My project is a maven project. 

Any solution to fix this ? 

1

Can you share a sample project? You can do that privately via https://uploads.jetbrains.com

0

Issue is happening with Enterprise application, so unfortunately can't share it. 

0

Does it help to rename .idea folder in the project's root and re-import the project? 

0

Sorry for delayed response. Removing .idea folder and re-importing hasn't resolved the error. 

If importing our codebase as eclipse project instead of as maven project and referencing to eclipse .classpath files recompiling is working. But we don't want to maintain dependencies in .classpath files and always read it from pom.xml

0

Unfortunately it is hard to say the reason without a sample. Note that when you compile a single file - IDE will not do a compilation of other files if there were any changes and if current file has references to a changed code - the compilation may fail b/c the changes in the other files were not updates (compiled). Why do you use action to compile a single class? IDE has incremental build feature - when the build action compiles only files changed since the last compilation. Do you use only IntelliJ IDEA to build the project or build also by Maven?

0

Thanks for all the inputs, I'm finally able to solve it. Issue is that as my project is a multi module project I have to build all the modules once then only the compile is happening. 

0

请先登录再写评论。