Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » newbie The public type Hello must be defined in its own
newbie The public type Hello must be defined in its own [message #720480] Tue, 30 August 2011 13:05 Go to next message
S.  is currently offline S.
Messages: 7
Registered: May 2011
Junior Member
The public type Hello must be defined in its own file.

This is the error message I'm getting when I try to do
Chapter09 Part3 from itextpdf.com/examples

I got the "HelloWorld " to work correctly.

Suggestions?

TIA
Steve
Re: newbie The public type Hello must be defined in its own [message #720506 is a reply to message #720480] Tue, 30 August 2011 13:53 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 25999
Registered: July 2009
Senior Member
Steve,

There can be at most one public class in a given .java file and its name
must match that of the file.


On 30/08/2011 10:05 AM, S. wrote:
> The public type Hello must be defined in its own file.
>
> This is the error message I'm getting when I try to do
> Chapter09 Part3 from itextpdf.com/examples
>
> I got the "HelloWorld " to work correctly.
>
> Suggestions?
>
> TIA Steve
>
Re: newbie The public type Hello must be defined in its own [message #720516 is a reply to message #720506] Tue, 30 August 2011 14:39 Go to previous messageGo to next message
S.  is currently offline S.
Messages: 7
Registered: May 2011
Junior Member
I think I have it SOLVED.

I had a file called hello.java

and

public class Hello extends HttpServlet {

when I got the error. When I changed it to:

public class hello extends HttpServlet {

my error went away.

Thanks a lot.
Re: newbie The public type Hello must be defined in its own [message #720549 is a reply to message #720516] Tue, 30 August 2011 15:04 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 25999
Registered: July 2009
Senior Member
Of course using a lower case name for a class name goes against the
recommended Java style guidelines so better to change the file to
Hello.java.


On 30/08/2011 11:39 AM, S. wrote:
> I think I have it SOLVED.
>
> I had a file called hello.java
> and
>
> public class Hello extends HttpServlet {
>
> when I got the error. When I changed it to:
>
> public class hello extends HttpServlet {
>
> my error went away.
>
> Thanks a lot.
>
Previous Topic:[CLI] Installation with p2.director
Next Topic:error message on start
Goto Forum:
  


Current Time: Thu Aug 21 14:02:48 EDT 2014

Powered by FUDForum. Page generated in 0.02231 seconds