我刚开始使用mac,当我尝试从命令行运行工具时,我遇到了一些问题。我正在尝试运行一个需要CRF++的软件。以下是错误;
Cannot load the example native code.
Make sure your LD_LIBRARY_PATH contains '.'
java.lang.UnsatisfiedLinkError: no CRFPP in java.library.path我在我的机器上安装了CRF++-058。我使用brew安装了CRF++ 0.58。
/usr/local/Cellar/crf++/0.58: 11 files, 784K, built in 32 seconds下面是brew医生的输出
Warning: Unbrewed .la files were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected .la files:
/usr/local/lib/libcrfpp.la有人知道怎么解决这个问题吗?任何帮助都将不胜感激。谢谢
发布于 2015-07-04 05:47:08
对于任何homebrew问题,请尝试:
brew doctor首先,听从好医生的建议。
如果做不到,请尝试
echo $LD_LIBRARY_PATH看看它是否包含它想要的点。如果没有,请尝试编辑$HOME/.profile并添加一行代码,如下所示
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:.然后注销并再次登录,然后尝试运行您的程序。
发布于 2017-07-31 15:57:27
在java中使用crfpp时,我遇到了同样的问题。
我的原始代码是这样的。
static {
try {
sf_model="/~/java";
sf_tagger = new Tagger(String.format("-m %s -v 3 -n2", sf_model+"/crfmodel"));
} catch (UnsatisfiedLinkError e) {
System.err.println("Cannot load the example native code.\nMake sure your LD_LIBRARY_PATH contains \'.\'\n" + e);
System.exit(1);
}
}但是我添加了一行,问题就解决了
static {
try {
sf_model="/~/java";
System.load(sf_model + "/libCRFPP.so");
sf_tagger = new Tagger(String.format("-m %s -v 3 -n2", sf_model+"/crfmodel"));
} catch (UnsatisfiedLinkError e) {
System.err.println("Cannot load the example native code.\nMake sure your LD_LIBRARY_PATH contains \'.\'\n" + e);
System.exit(1);
}
}https://stackoverflow.com/questions/31213434
复制相似问题