liblouis / liblouis-java

Java bindings for liblouis
GNU Lesser General Public License v3.0
4 stars 8 forks source link

Liblouis fails to initialize when there's a space in the path #16

Closed joeha480 closed 5 years ago

joeha480 commented 5 years ago

Liblouis fails to initialize when there's a space in the path:

java.lang.ExceptionInInitializerError
at org.liblouis.Translator.<clinit>(Translator.java:212)
[...]
Caused by: java.lang.RuntimeException
at org.liblouis.Louis.listResources(Louis.java:442)
at org.liblouis.Louis.access$500(Louis.java:52)
at org.liblouis.Louis$3.<init>(Louis.java:256)
at org.liblouis.Louis.getLibrary(Louis.java:252)
at org.liblouis.WideChar.<clinit>(WideChar.java:6)
... 24 more

On Windows this is higly problematic, as the default installation folder for applications is C:\Program Files

alexander233 commented 5 years ago

Could you provide your whole exception stacktrace? Could it be that the exception you mention is caused by another exception, similar to what I am getting:

java.lang.ExceptionInInitializerError at org.liblouis.Translator.(Translator.java:212) ( --- removed outer stack trace --) Caused by: java.lang.RuntimeException: directory does not exist at org.liblouis.Louis.listResources(Louis.java:448) at org.liblouis.Louis.access$4(Louis.java:441) at org.liblouis.Louis$3.(Louis.java:256) at org.liblouis.Louis.getLibrary(Louis.java:252) at org.liblouis.WideChar.(WideChar.java:6) ... 25 more

joeha480 commented 5 years ago

@alexander233 I have updated the stack trace, and you're right, it's similar.

bertfrees commented 5 years ago

@joeha480 can you try the new version? There are two version now. You should use the one with classifier "standalone".

https://oss.sonatype.org/content/repositories/snapshots/org/liblouis/liblouis-java/4.1.1-SNAPSHOT/

alexander233 commented 5 years ago

@bertfrees Elegant that you found an even shorter way to to solve this problem! Works well on my system.

joeha480 commented 5 years ago

@bertfrees It works!