I have a jar file named "stdlib.jar"
. This has many classes in its "Default Package"
. I have added this stdlib.jar
to my NetBeans Libraries. and Also "Build"-ed
it without using anything from stdlib.jar
. So that stdlib.jar
can be added to my "./dist/lib"
folder. But still I can't use any classes within stdlib.jar
What should I do to reuse any classes within stdlib.jar
?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With