aspose file tools
The moose likes Beginning Java and the fly likes Creating Class files without using the Default Package Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Creating Class files without using the Default Package" Watch "Creating Class files without using the Default Package" New topic
Author

Creating Class files without using the Default Package

Emmett Brannon
Greenhorn

Joined: May 20, 2011
Posts: 2

I have been using Eclipse to learn Java.
I'm near completion of an 87 lesson beginners tutorial and I have yet to figure out how to create a New Class and not get the following message at the top of the New Class Wizard.
"The use of the default package is discouraged."
Up to now I have been ignoring it and no issues have surfaced.
The warning bugs me and I don't want problems to start cropping up when I move to the next set of tutorials which will be more complex.

Would someone be so kind to explain how to alleviate the warning?

Sorry if its been explained before but I have searched everywhere for the answer to no avail.
I don't seem to be able to come up with the correct search term/terms.
Thank You
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56232
    
  13

I'd try Java packages.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Emmett Brannon
Greenhorn

Joined: May 20, 2011
Posts: 2

Bear Bibeault wrote:I'd try Java packages.
Oh for gosh sakes. I've been over complicating the issue and confusing Package with Project.
Now I know to look in the Projects Node, Open my project and if there is only the "Default Package" in the "Source Packages" folder...
All I need do in that case is:
Right click the "Source Packages" folder and select "New"/"Java Package.
That action will place a Non Default Package into my Project.
From there I add Classes to the new Non Default Package.

Thank You
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56232
    
  13

 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Creating Class files without using the Default Package
 
Similar Threads
package access
Question on Classes
Should a Java Bean be always put inside a package?
How to create object to a specific class by using its name as string variable with out using new.
Please explain this code