6

I just started using IntelliJ on Mac. The problem I met is that syntax error on my java file can't be detected and highlighted as in PC.

The problem is errors are not detected instead of errors not being highlighted, because I have checked the highlighting setting.

Any configuration I can play with to let the syntax error can be detected?

i.e.,

test = "Test"; There is no class declaration.

1
  • 2
    I use IntelliJ on my Mac daily and it's constantly highlighting my mistakes in red. If you haven't been to intellij-support.jetbrains.com/home it's worth looking there for help with your problem. Also, their support is very swift and abundantly helpful. Commented Mar 20, 2014 at 21:02

2 Answers 2

20

I'm going to guess that your Java classes have this icon when you open them:

enter image description here

What this means is that your Java class file isn't in a recognized source root. IntelliJ doesn't know that this is a source file, so it won't treat it as one.

Right-click on the folder, and select "Mark Directory As" -> "Sources Root".

enter image description here

After that, drag and drop your Java class into that folder. Then, you'll see it appear as this:

enter image description here

Then IntelliJ will report all of your errors.

Sign up to request clarification or add additional context in comments.

1 Comment

I had to look so many other places first before I found the simple solution that I'd moved a directory around and the project doesn't track directories by their hfs+ handle as I imagined. Thanks!
0

go to file ...>invalidate chaches amd restart and disable power saving mode it will work

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.