Question:
what are external libraries in java?
dat_nuggah
2012-09-28 14:13:53 UTC
I am asked to write a problem for my job assessment. I am using java to do. They say that i am not allowed to use external libraries to solve it.

what are external libraries?
how do I know if i am using it in my code?
can you give me an example if an instance where you are using an external library?
is like this "import _______" ?
Four answers:
Robert
2012-09-28 14:49:26 UTC
This article explains quite a bit:

http://en.wikipedia.org/wiki/Java_Classloader



It would appear that external libraries would exist in directories different to /lib (where the core Java libraries exist).



"Each Java class must be loaded by a class loader.[2] Furthermore, Java programs may make use of external libraries (that is, libraries written and provided by someone other than the author of the program) or they may be composed, at least in part, of a number of libraries.



When the JVM is started, three class loaders are used[3][4]:



Bootstrap class loader

Extensions class loader

System class loader



The bootstrap class loader loads the core Java libraries[5] located in the /lib directory. This class loader, which is part of the core JVM, is written in native code.



The extensions class loader loads the code in the extensions directories (/lib/ext, or any other directory specified by the java.ext.dirs system property). It is implemented by the sun.misc.Launcher$ExtClassLoader class."



External libraries will come into play a lot with mobile app applications using the Eclipse IDE, for instance, and its relationships with the Android SDK and Google Apps SDK.



Am not totally understanding all this bit, but think, yes, you will see "import ---" that do not mention Java like on https://github.com/lunixbochs/sublimelint/issues/18



Here are some more links (which sometimes actually cloud my thoughts on this last answer, have to say):

https://www.google.com.au/#hl=en&sugexp=les%3B&gs_nf=1&tok=m8U1ag2UBZz2XtaXQ2pGCw&cp=37&gs_id=8x&xhr=t&q=%22java%22+%22external+libraries%22+%22example%22&pf=p&output=search&sclient=psy-ab&oq=%22java%22+%22external+libraries%22+%22example%22&gs_l=&pbx=1&bav=on.2,or.r_gc.r_pw.r_qf.&fp=a80f56a052d2d330&biw=1067&bih=493
?
2012-09-28 15:07:38 UTC
External libraries are jar files that are not inside your project path. If my project is in c:\dev\java\myproject, and and my poi.jar file is in my c:\dev\lib folder, then I would add it as an external jar.



I keep them in a folder outside of the project so I can reference them from all of my projects without having to copy the files into each project's folder.



here are some of the external libs I use.

poi-xxx.jar from http://poi.apache.org

commons-xxx.jar

xbean.jar

xerxes.jar

dom4j.jar



When they say not to use any external libraries, they mean that you must use only what comes with java to do your task.



You will still need to use import statements to access parts of the java API.



Just don't add any jar files to your project, and you will be fine.
anonymous
2016-10-20 01:10:04 UTC
I dunno, besides the undeniable fact that it may join JFreeChart, that's fairly enormous library for... you waiting for this? ... charts. The even extra effective library is Jasper. entire books written on the thank you to apply those unfastened open-source libraries. If it is not that, you may discover the .jar. Then it may matter on whether you're utilising an IDE or no longer. while you're no longer, discover the thank you to apply -cp once you initiate a team of .jar with java.
python
2012-09-28 15:42:49 UTC
/*

My guess would be they are interested in your ability to solve a problem, libraries are built to do things for you at which defeats their purpose..



You're in luck the answer to your question is simple: do nothing and you have met this requirement..

*/





public class Core {





public static void main(String [] argss) {



// you could do some processing here.



}



}


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...