Delete HelloWorld.class file, won't run again [message #73808] |
Sun, 05 June 2005 02:00  |
Eclipse User |
|
|
|
Originally posted by: diviner_chan.hotmail.com_
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")
How to solve it? Thank you very much.
--
Best regards,
Diviner.
|
|
|
|
Re: Delete HelloWorld.class file, won't run again [message #74770 is a reply to message #74414] |
Tue, 07 June 2005 03:31   |
Eclipse User |
|
|
|
Originally posted by: divinerchan.gmail.com
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
|
|
|
Re: Delete HelloWorld.class file, won't run again [message #74988 is a reply to message #74770] |
Tue, 07 June 2005 11:08   |
Eclipse User |
|
|
|
Originally posted by: eclipse.rizzoweb.com
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
|
|
|
Re: Delete HelloWorld.class file, won't run again [message #74996 is a reply to message #74988] |
Tue, 07 June 2005 12:08  |
Eclipse User |
|
|
|
Originally posted by: diviner_chan.hotmail.com_
Eric Rizzo,
Yes, it is work for me. Thank you very much.
--
Best regards,
Diviner.
> 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.
|
|
|
Powered by
FUDForum. Page generated in 0.33798 seconds