I want to integrate TwitterAPIME
to my Blackberry
project. I have 3 Jar files provided by TwitterAPIME
. I am not sure how to link these 3 Jar files to my project.
My basic doubts are
What is an External Jar ? What is a Library ?
What's the difference between Adding jar, Adding External jar or Adding Library ?
To add an External Jar file in Eclipse, follow these steps: Right Click on Project -> Select Build Path -> Select Configure Build Path -> Library Tab in the following Dialog box.
A Library is a in-built Jar file from the JDK Directory or any other software eg J2ME-Polish as you can see in the Image above. Normally these Library files are developed by a manufacturer.
Adding A Library: Clicking on the 4th Button will open a dialog box as below.
You can add different libraries installed on your system. You can also add your own Library, by selecting "User Library".
JAR: A JAR File in your workspace.
External JAR: A JAR File in your file system. Use it for test purposes only, otherwise your project would be quite untidy.
Library: Built-in libraries such as JUnit. You don't need to know their location, these come with Eclipse.
In addition to the excellent answer given above by Lucifer, I recommend that people looking to develop or use Libraries, review the following BB supplied KB article:
Working with Libraries - shared, bundled, releasing, and using 3rd Party SDKs
Where the API is available as source or a Jar, I have found it significantly easier to include the source directly in the application. For example, in this case, rather than include the TwitterAPIME jar, you could include the TwitterAPIME source as a separate project in the application. As well as being easier to build, this can help in debugging or at least understanding issues with the API.
You might also find this sample, and in fact the containing Thread, useful:
Also building on Lucifer's answer, I have used "User Libraries" to bundle jars that are used across projects and dependent on a 3rd party service. Specifically, in my case, JMS jars. If I upgrade to a new JMS, or a different provider, etc, I can simply change the jars in my User Library and all projects referencing this are updated. Rather than changing jar dependency in every project.
An external Jar is a Jar in a path outh of your Eclipse environment: ie outside of both Eclipse jars and projects generated jars.
A libraray is a collection of jars prepared by someone for you.
You can cerate a User Library by selecting a group of external jars: that is useful if you have a group o jars that should logically work togehter. A further advantage of creating a library is that you can "reuse it's definition" by referencing it in multiple projects.
Use: Project->Properties->Add library-> select "User library" and press Next->User libraries->New insert a new name and later us "Add Jar" that adds any jar you need to you library definition. Later use this library in your project.
Sometimes adding jars directly in the blackberry project might cause some build problems. Here 'sa solution that works (90%):
Java Project
. Properties > Java Build Path
and choose Libraries
tab and click on Add External Jars
to add the 3 jars that are in your system and you want to use. Then OK
. Properties > Java Build Path
and click on the Projects
tab, click on Add
and select the project you just created and OK. I hope this help.
如果在Eclipse工作区中添加JAR,请说/ myproject / WebRoot / WEB-INF / lib但是在使用Select Jar弹出窗口时Eclipse不显示/ lib,退出向导并刷新WebRoot(rtClick并执行Refresh或F5):Eclipse仅显示尚未添加到项目中的新库,通常需要先手动刷新。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.