I have a problem while runing my application in eclipse. I make some edits like this:
String res = "newvalue";
System.out.println(res);
But when I run the application I still receive "oldvalue" in output. After this I tried to delete main() function - and I run application and I see "oldvalue" in output again.
Maybe it's some cache in JVM, or smth. else?
UPD:
It's 15:35 on my clock now. But in /bin folder I see .class files with 14:33 timestamp. I change source files (.java), press ctrl+f11 in eclipse and files in /bin folder are still 14:33 ...
UPD2:
After cleaning the project I receive the following problem:
The project was not built due to "Could not write file: D:\projects\NelderMead\bin\ru.". Fix the problem, then try refreshing this project and building it since it may be inconsistent
SOLUTION
The problem was that eclipse can't write file to the folder with spaces and UTF chars in it's name. So, I copy project to the new clean workspace and it runs without problems! Thx all for help detecting the problem!
File Navigation – Eclipse Shortcuts CTRL E – Open a file (editor) from within the list of all open files. CTRL PAGE UP or PAGE DOWN – Navigate to previous or next file from within the list of all open files. ALT <- or ALT -> – Go to previous or next edit positions from editor history list.
Trying to guess your problem: When you press the Run as button (White arrow in green circle), Eclipse doesn't run the program you're editing. Instead, it runs again the last program you executed. That's the reason why you see the output of another project: You're telling Eclipse to repeat its execution.
The quickest way to run a Java program is by using the Package Explorer view. Right click on the java class that contains the main method. Select Run As → Java Application.
Provide a public static void main(String[] args) method. You have to make sure that the editor containing your class (with main method) has the focus, otherwise Eclipse doesn't understand what you're trying to run.
You're executing an older class files, the reason could be
a compile error somewhere else (see problems view)
or your changed accidentally the source path so that the new source no longer gets compiled.
Try to clean the project and make sure the new classes are compiled to your output folder. The JVM doesn't have a cache for class files.
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