[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.newcomer] Re: Delete HelloWorld.class file, won't run again

Diviner wrote:
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.

If you deleted the .class file, you have to re-compile it. As I said below, you can do that by either touching the source code and saving it, or by choosing Project > Clean from the menu.




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