B4J Question Can't access 3rd party API in B4J - reposting from Library thread

droid

Member
Licensed User
Longtime User
I'm re-posting this question here because I'm not sure it belongs in the B4J Libraries section:
I have copied an executable jar file which contains code I want to use into the Libraries folder under B4J but it does not appear in the Referenced Libraries list after I right-click Refresh, so I cannot tick it because it is not there. As a result, when I compile a simple test program which includes the Dim lib1 as testlib statement, I get an 'Are you missing a referenced library?' message.
Someone please tell me why the library does not appear in the Referenced Libraries list and why I cannot access this library's routines? Must I do something besides copy the executable jar file into the B4J Libraries folder? I'm not skilled in B4J or Java (am coming from VB6) so please explain as simply as possible.
 

Daestrum

Well-Known Member
Licensed User
Longtime User
Basically, an external or user written library for B4J will consist of two files, the jar file and an XML file which describes the functions and parameters within the jar file to B4J.
Without the XML file B4J has no way of knowing what functions are available within the code, and as there is no XML file matching the jar file will assume it not to be a library.
To use a pre-existing library, you write a portion of code which calls the library functions you want (a wrapper), this is then linked to the library and the resulting code is processed by a doclet to produce the XML file.Then both jar and the XML files are copied into your library folder.
 
Upvote 0

droid

Member
Licensed User
Longtime User
Basically, an external or user written library for B4J will consist of two files, the jar file and an XML file which describes the functions and parameters within the jar file to B4J.
Without the XML file B4J has no way of knowing what functions are available within the code, and as there is no XML file matching the jar file will assume it not to be a library.
To use a pre-existing library, you write a portion of code which calls the library functions you want (a wrapper), this is then linked to the library and the resulting code is processed by a doclet to produce the XML file.Then both jar and the XML files are copied into your library folder.
Many thanks to you and Erel for your replies. It has been a challenge for me to learn both a new programming language and new tools in the limited free time I have available. I appreciate your simple explanations and clear instructions.
 
Upvote 0
Top