-1

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?

SKay
  • 147
  • 1
  • 22
  • Doesn't sound familiar, but can you show the files? – Danielson Jul 29 '15 at 15:29
  • I found that i have included a package of old project in new main file, so a similar method is calling from that file. Sorry for the inconvenience caused. wasted so much time debugging eclipse!!! :( – SKay Jul 29 '15 at 15:55
  • Stuff happens,,, sometimes it helps to start creating a question, try to find all information necessary, and what you've done... Only to figure out what you've forgot :-)... But if that's the answer,,, it's better to post it as your answer. Since it's not only a comment but the answer... Any who, good that you can continue now. Btw, I had similar problems in the past, now I learned, to clean stuff neurotically :p. It costs more time, but clears some odd problems – Danielson Jul 29 '15 at 16:00
  • 1
    yes Danielson,simple mistakes can cost more, i was not normal for past 2 days! we learn from mistakes. have to be cautious that same mistake is not repeated :) – SKay Jul 29 '15 at 16:23

2 Answers2

0

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.

krzydyn
  • 1,012
  • 9
  • 19
0

I copied a main file from other project, and that package got retained in that file. when i modify the code in copied main file, forgot to modify a constructor name which was pointing to earlier package. I missed to trace import statements and it was not expanded. when i try to copy the file to post in stackflow, i found earlier package was included and found that was the culprit!!

SKay
  • 147
  • 1
  • 22