简体   繁体   中英

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.

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

File -> Invalidate Caches/Restart

I solved this problem by removing the Intellij IDEA 14.0.3 Community Edition installation and its configuration files from ~/.IdeaIC14, installing an older version (13.1.6) and then installing again 14.0.3 and using the configuration files from the older installation.

So my conclusion is that it might be an IDEA issue if you do a fresh install of 14.0.3.

Can someone else confirm this issue?

Try deleting and rebuilding your artifact in your deployment configurations. That does the trick for me.

I solved this by deleting the folder ".idea". Note that this does remove all "Run/Debug Configurations" which will have to be setup again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM