“java/lang/NoClassDefFoundError: java/lang/Object”什么时候运行JNI程序
我对安装抄写员和安装感到非常痛苦。 HDFS。值得赞赏的是,我解决了大部分问题。然而,我被困在这里了。
我安装 libhdfs ,然后编写一个“Hello world”测试:
#include <iostream>
#include <string>
using namespace std;
#include "hdfs.h"
int main(int argc,char *argv[]){
string host = "10.210.74.143";
int port = 9000;
hdfsFS fs = hdfsConnect(host.c_str(),port);
return 0;
}
当我运行它时,它会打印此消息:
Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object
我发誓我已经设置了 CLASSPATH
I am so pain for installing scribe & hdfs. worth to appreciate, I solved most of the problems. However, I am stuck here.
I install libhdfs , and I write a "Hello world" test:
#include <iostream>
#include <string>
using namespace std;
#include "hdfs.h"
int main(int argc,char *argv[]){
string host = "10.210.74.143";
int port = 9000;
hdfsFS fs = hdfsConnect(host.c_str(),port);
return 0;
}
It print this msg when I run it:
Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object
I swear I have set the CLASSPATH
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,您正在运行 C 程序,而不是使用 Java 程序中的动态库。这真的是你想要做的吗?
如果是这样,也许您需要显式创建一个 JVM(有趣):
请参阅http://www.inonit.com/cygwin/jni/invocalApi/c。 html 除非 hdfsConnect 函数为您完成此操作。
Firstly, you are running a C program instead of using a dynamic library from a Java Program. Is that really what you intended to do?
If so, maybe you need to explicitly create a JVM (interesting):
See http://www.inonit.com/cygwin/jni/invocationApi/c.html unless hdfsConnect function does it for you.