Search code examples
javaeclipseeclipse-luna

eclipse Luna + Java : 2 main files, compilation not proper


Having strange problem for couple of days.

I have written 2 main files, so to test based on need. I have been facing following strange problems,

  1. The main fail stops executing after some statement. doesnt hang! after cleaning the build, and compiling again it got executing!
  2. I updated few System.out.println statements, but i am cant see new statements.
  3. I excluded the unwanted main files and tried. even commented the whole unwanted main files and tried.
  4. I even tried changing the main file name that i am using.

I observe the eclipse is not compiling the main file i wanted or it is taking old class file some where residing? I cant see the unwanted class anywhere in the workspace!!

anyone experienced similar problem?


Solution

  • Please try right-mouse click on the class in "Package Explorer", then form the menu choose "Run As" -> "Java Application". This will run (and compile if needed) the selected source code.