yukuku / androidbible

Open Source Bible for Android
https://alkitab.app
Apache License 2.0
321 stars 177 forks source link

Cannot convert Yet to Yes #72

Closed JJK96 closed 4 years ago

JJK96 commented 4 years ago
java -jar YetToYes2.jar translation.yet translation.yes
Exception in thread "main" java.lang.UnsatisfiedLinkError: yuku.snappy.codec.SnappyImplNative.nativeSetup()J
    at yuku.snappy.codec.SnappyImplNative.nativeSetup(Native Method)
    at yuku.snappy.codec.SnappyImplNative.<init>(SnappyImplNative.java:12)
    at yuku.snappy.codec.Snappy$Factory.newInstanceNative(Snappy.java:42)
    at yuku.snappy.codec.Snappy$Factory.newInstance(Snappy.java:56)
    at yuku.alkitab.yes2.compress.SnappyOutputStream.<init>(SnappyOutputStream.java:22)
    at yuku.alkitabconverter.yes_common.Yes2Common$CompressionInfo.getOutputStream(Yes2Common.java:190)
    at yuku.alkitabconverter.yes_common.Yes2Common$CompressiblePericopesSection.<init>(Yes2Common.java:267)
    at yuku.alkitabconverter.yes_common.Yes2Common.createYesFile(Yes2Common.java:161)
    at yuku.alkitabconverter.yes_common.Yes2Common.createYesFile(Yes2Common.java:149)
    at yuku.alkitabconverter.yet.YetToYes2.main(YetToYes2.java:119)
    at yuku.alkitabconverter.yet.YetToYes2.main(YetToYes2.java:42)

No other errors, just some warnings like:

warning: is not a valid verse in KJV versification: verse 2 5 24

But this is correct for this translation.

I also have snappy installed (using npm)

yukuku commented 4 years ago

Hi @JJK96

It is because libsnappy from your system is used, which is not compatible with the libsnappy that YetToYes2 optionally use. If you can remove libsnappy from your system and run the above command again, the Java version of snappy compression will be automatically used as a fallback.

JJK96 commented 4 years ago

I cannot remove snappy from my system, since it is required by other packages I use.

Is there maybe another solution?

yukuku commented 4 years ago

@JJK96 I think it is possible to modify the Java library loading search path by running it with -Djava.library.path="some/non/existent/path"

e.g.

java -Djava.library.path="some/non/existent/path" -jar YetToYes2.jar

I didn't try it myself, I am assuming this will make the loading of the system native library libsnappy fail and YetToYes2.jar will fallback to using java snappy.

JJK96 commented 4 years ago

Running it with

java -Djava.library.path="" -jar YetToYes2.jar

Worked perfectly, thank you.