File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Compiler Says That My Class Is Not Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Compiler Says That My Class Is Not "public"!" Watch "Compiler Says That My Class Is Not "public"!" New topic
Author

Compiler Says That My Class Is Not "public"!

JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
I have a public interface OnlineUser.java and I have a public class OnlineUserImpl.java that implements the interface.

In my JSP, I created an instance of OnlineUserImpl with the OnlineUser type:

and later on in my JSP, I tried to:

I got an error message saying:

OnlineUserImpl() is not public in org.apache.artimus.authorization.OnlineUserImpl; cannot be accessed from outside package
OnlineUser onlineUser = new OnlineUserImpl();


Let me give my code for OnlineUser.java:

and my code for OnlineUserImpl.java:
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258


Doesn't look public to me ...


Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
Mighty Kush
Greenhorn

Joined: Jun 11, 2004
Posts: 1
OnlineUserImpl() { }

I think that constructor needs to public.
JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
I see. Thanks a lot.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Compiler Says That My Class Is Not "public"!