| [news.eclipse.newcomer] Re: Delete HelloWorld.class file, won't run again |
Eric Rizzo,
I don't know do compile/re-compile in a separate operation. I do it in Run->Run from context menu of Project in Package Explorer or Run->Run Application then select particular project.
-- Best regards, Diviner.
Diviner wrote:
Hi all,
I tried to write a simple console application "HelloWorld" and work well in a development cycle. Then I tried to delete the HelloWorld.class to let Eclipse make it for me again, but always failed. It gave me the error: java.lang.NoClassDefFoundError: HelloWorld Exception in thread "main" (with a dialog -- "Could not find the main class. Program will exit")
After you deleted the .class file, how did you tell Eclipse to re-compile it for you? In a standard configuration, Eclipse will re-build the project (re-compile all Java source files) when you make a change to the source and save it, or if you select Project > Clean from the menu.
HTH, Eric