soham.m17 soham.m17 - 1 year ago 96
Java Question

Adding Default Package's Classes in NetBeans

I have a jar file named

. This has many classes in its
"Default Package"
. I have added this
to my NetBeans Libraries. and Also
it without using anything from
. So that
can be added to my
folder. But still I can't use any classes within

What should I do to reuse any classes within

Answer Source

Using "Default Package" package for libraries or even for a project is highly discouraged. If you use default package then the classes name should be unique or else they will override all the java.lang classes.

Now coming to your situation. To use your stdlib.jar if you've added it in your library then you should be able to use it. You can use your stdlib.jar from your default package of the project in which you are using it. Other than default package you cannot use it as it will search your stdlib.jar class in that package.

Hope this makes you clear. Thanks.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download