Hi everyone, I tried use langugetool in a servlet, but show two error:
Could not initialize class com.sun.jna.Native
java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native
at org.languagetool.rules.spelling.hunspell.Hunspell.(Hunspell.java:92)
at org.languagetool.rules.spelling.hunspell.Hunspell.getInstance(Hunspell.java:68)
at org.languagetool.rules.spelling.hunspell.Hunspell.getInstance(Hunspell.java:54)
at org.languagetool.rules.spelling.hunspell.HunspellRule.init(HunspellRule.java:163)
at org.languagetool.rules.spelling.SpellingCheckRule.resetIgnoreTokens(SpellingCheckRule.java:104)…
i have the same problem as state by 1. of Laotshi. I already tried putting the jna.jar and hunspell-native-libs.jar into the WEB-INF/lib and TOMCAT_HOME/lib directories but with no success.
Any idea why the class is not found (or could not be initialized)?
Wow that was fast. And it immediately gave me the right hint. I was not using the Oracle JRE 7 but the OpenJDK one. I switched to the original one and now it is running.