[jsword-devel] API primer?

Joe Walker jsword-devel@crosswire.org
Sat, 20 Dec 2003 05:57:59 +0000


Hi,

You shouldn't need Config at all since it is simply a layer sat on top 
of the real configuration options. If you have a look at config.xml then 
you might be able to guess what it does to setup the system though.

However the short version is this:
   org.crosswire.jsword.book.sword.SwordBookDriver.setSwordDir();

If I recall correctly it takes and array of strings that are paths to 
directories containing sword modules.

I've fixed the link and checked it back into CVS. Tonight's nightly 
build should promote it to the web site, however I think it won't help 
you since it just links to the API Examples file you already know about.

Joe.

Nathaniel Alderson wrote:

> Hey all,
> 
> I am interested in learning and using the jsword API but am having a
> little trouble understanding it's basic structure. I perused the
> APIExample class and thought that I might use it to do some
> experimenting, however by looking at the code I can't see how the API
> knows where to find my sword modules. I have the feeling I need to use
> the Config class but am having problems with the following code:
> 
> 
> import org.crosswire.jsword.examples.APIExamples;
> import org.crosswire.common.config.Config;
> import org.jdom.Document;
> import org.crosswire.jsword.util.Project;
> 
> /**
>  * Describe class <code>JSwordTest</code> here.
>  *
>  * @author <a href="mailto:"></a>
>  * @version 1.0
>  */
> public class JSwordTest {
> 
>     /**
>      * Describe <code>main</code> method here.
>      *
>      * @param args a <code>String[]</code> value
>      */
>     public static void main(String[] args) {
> 	
> 	    Config config = new Config("JSword Test");
> 
>     }     
> }
> 
> 
> And when I run this fruitless code I get the following exception:
> 
> Exception in thread "main" java.lang.VerifyError: (class:
> org/apache/log4j/LogManager, method: <clinit> signature: ()V)
> Incompatible argument to function
> 	at org.apache.log4j.Logger.getLogger(Logger.java:94)
> 	at org.crosswire.common.util.Logger.<init>(Logger.java:75)
> 	at org.crosswire.common.util.Logger.getLogger(Logger.java:43)
> 	at org.crosswire.common.config.Config.<clinit>(Config.java:502)
> 	at JSwordTest.main(JSwordTest.java:21)
> 
> Any help would be appreciated. By the way, I noticed that there is a
> broken link (API Primer) that sounds like what I am looking for.
> 
> Thanks,
> Nate 
> 
> _______________________________________________
> jsword-devel mailing list
> jsword-devel@crosswire.org
> http://www.crosswire.org/mailman/listinfo/jsword-devel