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

15 comments
Comment actions Permalink

Hi Anders,

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

0
Comment actions Permalink

Hi Roman,

I am using javac.
Project SDK is java 1.5

0
Comment actions Permalink

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

0
Comment actions Permalink

Yes, a rebuild don't fix the problem

0
Comment actions Permalink

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

0
Comment actions Permalink

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
Comment actions Permalink

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

0
Comment actions Permalink

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
Comment actions Permalink

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

0
Comment actions Permalink

I have tried. But no luck.. =/

0
Comment actions Permalink

Same error here.

I'm giving up from JetBrains IDE for java.

0
Comment actions Permalink

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

0
Comment actions Permalink

GUYS

```

mvn clean install

```

install the dependencies

1
Comment actions Permalink

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
Comment actions Permalink

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

Please sign in to leave a comment.