Java TypeInitializationException未处理
我正在用C语言使用opennlp工具。 我编写了以下代码:Java TypeInitializationException未处理,java,Java,我正在用C语言使用opennlp工具。 我编写了以下代码: string modelpath = @"D:\models\en-sent.bin"; java.io.FileInputStream modelInpStream = new java.io.FileInputStream(modelpath); SentenceModel model = new SentenceModel(modelInpStream); SentenceDetectorME sentenceDetector =
string modelpath = @"D:\models\en-sent.bin";
java.io.FileInputStream modelInpStream = new java.io.FileInputStream(modelpath);
SentenceModel model = new SentenceModel(modelInpStream);
SentenceDetectorME sentenceDetector = new SentenceDetectorME(model);
但它导致行中出现TypeInitializationException:
SentenceModel model = new SentenceModel(modelInpStream);
异常消息:
TypeInitializationException was unhandled
The type initializer for 'java.nio.charset.StandardCharsets' threw an exception.
假设您使用IKVM代码将openNLP jar文件转换为.Net,您应该只需要在项目中包含IKVM字符集dll,就可以正常工作。Umm,这是Java而不是C?除非你真的在用SharpNLP?