You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hadoop.apache.org by Daegyu Han <hd...@gmail.com> on 2019/05/31 16:07:22 UTC

How to run libhdfs (C interface to HDFS) ?

Hi all,

I tried to run hdfs c++ file in hdfs and tried the followed command.

gcc above_sample.c -I$HADOOP_HDFS_HOME/include
-L$HADOOP_HDFS_HOME/lib/native -lhdfs -o above_sample

which is at https://hadoop.apache.org/docs/r2.8.0/hadoop-project-dist/hadoop-hdfs/LibHdfs.html

But I got the error messages.

# gcc hdfs_read.c -I$HADOOP_HOME/include -L$HADOOP_HOME/lib/native
-lhdfs -o hdfs_read

/usr/bin/ld: warning: libjvm.so, needed by
hadoop-2.9.2/lib/native/libhdfs.so, not found (try using -rpath or
-rpath-link)
/usr/bin/ld: hadoop-2.9.2/lib/native/libhdfs.so: undefined reference
to `JNI_GetCreatedJavaVMs@SUNWprivate_1.1'
/usr/bin/ld: hadoop-2.9.2/lib/native/libhdfs.so: undefined reference
to `JNI_CreateJavaVM@SUNWprivate_1.1'

I already tried to add hadoop classpath to HADOOP_HOME variable but it
did not work.
I can't find the answer other web pages.

How can I solve this problem?

Best regards
Daegyu

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@hadoop.apache.org
For additional commands, e-mail: user-help@hadoop.apache.org