How to solve various compilation errors and deffound exceptions when the C program accesses hadoop

Source: Internet
Author: User

When CProgramCompile the program, but it tells you that the configuration, logging, and other classes are missing. If there is a lack of classes, add × in the classpath. Jar path;

Note that classpath is a search class in a file. (no recursive search is available)

While path searches for files (recursive search)

During compilation, various HDFS. h cannot be found:

When I write the MAKEFILE file below, it will be okay:

 

 
Hadoop_install =/usr/local/hadoopjava_home =/usr/lib/JVM/java-1.6.0-openjdk-i386PLATFORM = Linux-i386-32CPPFLAGS =-I $ (hadoop_install) /src/C ++/libhdfslib =-L $ (hadoop_install) /C ++/Linux-i386-32/liblib + =-I $ {java_home}/includelibjvm =$ {java_home}/JRE/lib/i386/client/libjvm. soldflags + =-lhdfstest: test. CGCC $? $ (Cppflags) $ (LIB) $ (ldflags) $ (libjvm)-o $ @ clean: Rm Test

 

Various types or library so files cannot be found at runtime

My ~ /. Bashrc:

It is normal:

 

Export hadoop_install =/usr/local/hadoop export hadoop_jardir =$ {hadoop_install}/jardir export classpath =.: $ java_home/lib/tools. jar: $ java_home/lib/DT. jar: $ hadoop_ja rdir/hadoop-core-1.0.4.jar: $ packages/hadoop-tools-1.0.4.jar: $ hadoop_jar DIR/commons-configuration-1.6.jar: $ hadoop_jardir/commons-logging-1.1.1.jar: $ hadoop_jardir/commons-logging-api-1.0.4.jar: $ hadoop_jardir/log4j-1.2.15.jar: $ hadoop_jardir/commons-lang-2.4.jar

 

 

1. If you want to delete a variable available:

Unset variable name

2. To modify:
Set variable name

3. To add a variable temporarily:
Export variable name =

4. Change the configuration file to be permanent;

/Etc/profile

~ /. Bashrc

Add:

Export variable name =

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.