8

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.

yole
  • 80,603
  • 15
  • 224
  • 177
Adrian Enciu
  • 123
  • 1
  • 5

4 Answers4

5

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

File -> Invalidate Caches/Restart

sahitya
  • 3,470
  • 1
  • 7
  • 12
  • Yes, I know but I need this thing to work outside the box, as it did until now. Otherwise I will have to recompile manually each time I do a modification in my code before running. – Adrian Enciu Feb 19 '15 at 07:41
1

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?

Adrian Enciu
  • 123
  • 1
  • 5
0

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

Logs
  • 125
  • 1
  • 2
  • 11
0

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

Edward Ross
  • 2,356
  • 1
  • 16
  • 16