简体   繁体   中英

Import an opensource library and include its javadoc with RCP

How to import an open source library into the rcp framework so that I have the java doc for each method and class? What steps are involved here?

First, copy your .jar files into your plugin (I typically put them in the "lib" folder"). Next, right click on your plugin in the Package Explorer and go to "Properties". Under "Java Build Path" -> Libraries you will need to choose your jar file. When you see it in the list, expand it, and click on "Javadoc location: " then choose "Edit". This will allow you to choose a URL for the library's javadoc or select it from an archive file. You also have to add this jar to your MANIFEST.MF in the Bundle-ClassPath ("Runtime" in the Eclipse IDE) if Eclipse doesn't do that for you.

What this does is add the library to your classpath for when your classes are compile, so that when you make calls to classes in the library the java jvm will be able to find them. Additionally, it lets Eclipse know where it can find the javadoc for the libary to give you all the benefits of the IDE integration with javadoc. Updating the MANIFEST.MF lets the RCP class loader know where to look your file, so that when you run your plugin on the RCP platform it can find the library.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM