False compile error

Answered

Hi,

Something strange is happening in Idea..

When I build my project, Idea tells me that I have 3 compile errors. Then I go to the classes with errors but there is no red lines or any other indication og where the errors are in the code. To get rid of the errors I can change one of the methods in my class from public to private, build, change the method back to public and build again. It looks like an Idea caching problem.

Can anyone help?

Regards
Anders

0
18 comments

Hi Anders,

which compiler (Settings | Compiler | Java Compiler) do you use?

0
Avatar
Permanently deleted user

Hi Roman,

I am using javac.
Project SDK is java 1.5

0

Have you tried to rebuild a project completely  (Build | Rebuild Project)?

0
Avatar
Permanently deleted user

Yes, a rebuild don't fix the problem

0

Ok, then please do File | Invalidate caches. If the problem is cache-related this should fix it.

0
Avatar
Permanently deleted user

Have tried that too.. Same result.

The strange thing is that I can make a fresh check out from subversion, open Idea, compile and the false error pops up..

0

Well, it's hard to tell more without seeing actual problems.
What errors a compiler reports?

0
Avatar
Permanently deleted user

Yes I know. Was hoping that anyone have had the same problem..

The first error: unreported exception java.lang.Exception; must be caught or declared to be thrown

0

Could you please try to create a small project which reproduces your issue?

0
Avatar
Permanently deleted user

I have tried. But no luck.. =/

0
Avatar
Permanently deleted user

Same error here.

I'm giving up from JetBrains IDE for java.

0

Could you please provide a project example to reproduce the problem?

0
Avatar
Permanently deleted user

GUYS

```

mvn clean install

```

install the dependencies

1

I am facing the same issue in Intellij Idea 2019.3.5 ultimate and ran into the same issue. The java file shows a number of compiler issues while no errors show up in the maven build.

 

I have already invalidated the cache, reimported the project but still the error.  

0

Please try deleting the System directory: https://www.jetbrains.com/help/idea/tuning-the-ide.html#system-directory when the IDE is not running.

0
Avatar
Permanently deleted user

Serge Baranov what are the implications of deleting System directory? I am facing this compilation problem with only one of my projects, I am afraid that deleting Systems dir might mess up other projects for me

0

No, it will not affect your projects. The caches will be rebuilt.

0

I faced the same error. Deleting the build folder and building the project again worked for me.

0

Please sign in to leave a comment.