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.
Open a file in the editor or select in the Project tool window and choose <VCS> | Show History from the context menu.
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.
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.
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.
you can try invalidating the cache and restarting intellij, in many cases it will help.
File -> Invalidate Caches/Restart
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With