XGBoost Java实现:从XGBoost包使用DMatrix时的java.lang.UnsatisfiedLinkError

时间:2016-03-18 17:27:10

标签: java dll xgboost

我在Windows 8.1中使用带有maven插件的eclipse luna。我已经通过运行create_Jni在xgboost4j / src / main / resources / lib / xgboost4j.dll中添加了xgboost4j.dll(重命名libxgboost.dll,它是通过运行" make"在xgboost文件夹中生成的)。蝙蝠。当我在示例包中运行BasicWalkThrough.java时,它会输出以下错误

Exception in thread "main" java.lang.UnsatisfiedLinkError:ml.dmlc.xgboost4j.java.XGBoostJNI.XGDMatrixCreateFromFile(Ljava/lang/String;I[J)I
    at ml.dmlc.xgboost4j.java.XGBoostJNI.XGDMatrixCreateFromFile(Native Method)
    at ml.dmlc.xgboost4j.java.DMatrix.(DMatrix.java:83)
    at ml.dmlc.xgboost4j.java.example.BasicWalkThrough.main(BasicWalkThrough.java:52)

请让我知道我做错了什么。

提前致谢。

1 个答案:

答案 0 :(得分:0)

Windows目前不支持xgboost,请参阅此处: https://github.com/dmlc/xgboost/issues/1051

在linux / OS X上,我通过将JAVA_HOME设置为jdk目录并安装gcc来解决了这个问题。