Friday, January 9, 2009

Proof Of Concept - 5 of 8 : Create Java Archive File (JAR)

A Java JAR file is used for aggregating many files into one. It is generally used to distribute Java classes. All IB's API classes in twsapi\com\ib\client needs to be packaged into .jar file in order to be used in JRuby.

Run NetBeans and choose new project for Java class library. I have named my project TwsApi. Click Finish and the new project is created.
In Explorer, copy com\ib\client folder (created in Proof Of Concept - 4 of 8) and paste it into TwsApi\src folder.
In NetBeans, right click on the project node and select Properties. In Categories: Sources, press Add Folder button and select TwsApi\src\com.


Click OK and the folder is now added to the project. Press F11 to build the project and TwsApi.jar should be created in TwsApi\dist folder.

No comments: