Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellij IDEA doesn't detect file changes, therefore doesn't make before running

I'm having the following class:

public class MyClass {
  public static void main(String[] args) {
    System.out.println("abc");
  }
}

When I'm running the main method, "abc" is printed, as expected.

Then, after modifying "abc" with "def", I got "abc" printed instead of "def". I tried to manually trigger the Make button, but I got the same wrong result. Also, in the Event Log tab, the "All files are up-to-date" message is logged each time I try to run the method, even though I changed what to print.

If I right-click the file and choose "Compile MyClass.java", all works as expected.

I'm having this problem on my workstation (xubuntu 14.04), after I changed my hard drive to an SSD (if it matters). Other collegues with and without SSD don't have this problem, that's why I'm thinking it may be a wrong IDEA configuration.

like image 266
Adrian Enciu Avatar asked Feb 18 '15 16:02

Adrian Enciu


People also ask

How do I see uncommitted changes in IntelliJ?

Open a file in the editor or select in the Project tool window and choose <VCS> | Show History from the context menu.

How do I track changes in IntelliJ?

Right-click anywhere in the editor and choose Local History | Show History from the context menu. In the dialog that opens, the left-hand pane shows a list of all saved revisions of the current file with timestamps.

How do I see commit history in IntelliJ?

You can also select the Show Commit Timestamp option if you want IntelliJ IDEA to show the commit timestamp instead of the time when a change was authored. Click to choose the type of info you want to see: Show Details to display the commit message for the selected revision.

Why cant I press run on IntelliJ?

Try right-clicking within the file that contains a main method, and click "Run CLASSNAME. main()". That should generate a run configuration for the file that will let you use the green play button.


1 Answers

you can try invalidating the cache and restarting intellij, in many cases it will help.

File -> Invalidate Caches/Restart

like image 107
sahitya Avatar answered Nov 15 '22 00:11

sahitya