Return-Path: X-Original-To: apmail-hadoop-common-user-archive@www.apache.org Delivered-To: apmail-hadoop-common-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 174509E44 for ; Tue, 7 Feb 2012 09:39:20 +0000 (UTC) Received: (qmail 66901 invoked by uid 500); 7 Feb 2012 09:39:16 -0000 Delivered-To: apmail-hadoop-common-user-archive@hadoop.apache.org Received: (qmail 66577 invoked by uid 500); 7 Feb 2012 09:39:14 -0000 Mailing-List: contact common-user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-user@hadoop.apache.org Delivered-To: mailing list common-user@hadoop.apache.org Received: (qmail 66569 invoked by uid 99); 7 Feb 2012 09:39:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Feb 2012 09:39:13 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lblabs@gmail.com designates 209.85.215.48 as permitted sender) Received: from [209.85.215.48] (HELO mail-lpp01m010-f48.google.com) (209.85.215.48) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Feb 2012 09:39:04 +0000 Received: by lagw12 with SMTP id w12so5279417lag.35 for ; Tue, 07 Feb 2012 01:38:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:reply-to:date:message-id:subject:from:to:content-type; bh=FOYC2PRKBjs9lboW4PG0ev+sA5krhIifxMOfbNaJ4Q8=; b=TMvzq3uh0QzoNbcG1fi+MN4MqhnDIcr+bHd9jMvgGz5MQFxixdhSs6+uB95mwt+8e4 Nky7dJmbEzBMU0xDxowoxUrThuqhiUAVqxw6m041I/3ggs0kmWFBi3PK7YsxJTu8j4eS lWhBCReFigv4//hQ0RtRDN0dWMM7xEOtMCIMU= MIME-Version: 1.0 Received: by 10.112.100.200 with SMTP id fa8mr5840637lbb.99.1328607523830; Tue, 07 Feb 2012 01:38:43 -0800 (PST) Received: by 10.112.25.163 with HTTP; Tue, 7 Feb 2012 01:38:43 -0800 (PST) Reply-To: bing.li@asu.edu Date: Tue, 7 Feb 2012 17:38:43 +0800 Message-ID: Subject: Unable to Load Native-Hadoop Library for Your Platform From: Bing Li To: common-user@hadoop.apache.org Content-Type: multipart/alternative; boundary=14dae9d7186680fcf204b85c8b07 X-Virus-Checked: Checked by ClamAV on apache.org --14dae9d7186680fcf204b85c8b07 Content-Type: text/plain; charset=ISO-8859-1 Dear all, I got an error when running a simple Java program on Hadoop. The program is just to merge some local files to one and put it on Hadoop. The code is as follows. ...... Configuration conf = new Configuration(); try { FileSystem hdfs = FileSystem.get(conf); FileSystem local = FileSystem.getLocal(conf); Path inputDir = new Path("/home/libing/Temp/"); Path hdfsFile = new Path("/tmp/user/libing/example.txt"); try { FileStatus[] inputFiles = local.listStatus(inputDir); FSDataOutputStream out = hdfs.create(hdfsFile); for (int i = 0; i < inputFiles.length; i ++) { System.out.println(inputFiles[i].getPath().getName()); FSDataInputStream in = local.open(inputFiles[i].getPath()); byte buffer[] = new byte[256]; int bytesRead = 0; while ((bytesRead = in.read(buffer)) > 0) { out.write(buffer, 0, bytesRead); } in.close(); } out.close(); } catch (IOException e) { e.printStackTrace(); } } catch (IOException e) { e.printStackTrace(); } ...... I run it with ant and got the following warning. BTW, all the relevant jar packages from Hadoop are specified in the build.xml. [java] 2012-2-7 17:16:18 org.apache.hadoop.util.NativeCodeLoader [java] Warning: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable The program got a correct result. But I cannot figure out what the above problem is. Thanks so much! Bing --14dae9d7186680fcf204b85c8b07--