aviks / Taro.jl

Read and write Excel, Word and PDF documents in Julia
Other
124 stars 25 forks source link

define __init__() to simplify usage #32

Closed bjarthur closed 7 years ago

bjarthur commented 7 years ago

the docs say one has to Taro.init() before doing anything. you should consider doing this automatically for the user in an __init__() function as described here. as an example see FreeTypeAbstraction.jl.

aviks commented 7 years ago

There is a complication with the use of the JVM that drives this design.

There can only be one embedded JVM per process. And the classpath used by the JVM can only be set before it is initialised. Therefore, if a user wants to use, within Julia, two packages that load the JVM (say Taro and JDBC), I need to give them the ability to manually configure the classpath for both the projects. Otherwise, the first package for which you do an using will load, and the second cannot be used.

So this is the reason why I don't do automatic loading of the JVM when loading the Julia module.

bjarthur commented 7 years ago

i see. you might want to briefly mention this in Usage section of the docs, as it is something that that an inexperienced Java user, like me, would stumble on.