Issue
I've heard that you can use classpath
to use classes in other libraries. I googled about this and all results tell me to use the command line to compile the program and specify a classpath. But who would use command line to compile java programs nowadays?
I am using eclipse and Android Studio. I mean they are IDEs so they surely can set the classpath very easily, right?
Also, I want to know the word "library" in this context is just a jar file , right?
Solution
In Eclipse:
Right-Click on the Project → Build Path → Configure Build Path
. Under Libraries tab, click Add Jars or Add External JARs
and give the Jar.
Image from link
Android Studio: from Android Studio: Add jar as library?
- Right click on the module in the left hand panel and choose
Open Module Settings
. - On the left panel of the dialog, choose
Libraries
. - Click the
+
sign above the panel second from theleft -> Java
- Select your local jar and add it to the project.
Answered By - Sumit Singh