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?
I have a jar file named stdlib.jar . This has many classes in its
Share
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.langclasses.Now coming to your situation. To use your
stdlib.jarif you’ve added it in your library then you should be able to use it.You can use your
stdlib.jarfrom your default package of the project in which you are using it. Other than default package you cannot use it as it will search yourstdlib.jarclass in that package.Hope this makes you clear. Thanks.