找不到库

slmsl1lt  于 2021-06-03  发布在  Hadoop
关注(0)|答案(1)|浏览(419)

在w7上安装haddop hdinsight之后。无法编译具有特定于hadoop实现的java程序。他们错误地说:

c:\Hadoop\hadoop-1.1.0-SNAPSHOT\bin>javac -classpath `C:\Hadoop\hadoop-       1.1.0-SNA
    PSHOT\hadoop-core.jar` C:\Z\WordCount.java -d C:\Z
    C:\Z\WordCount.java:6: error: package org.apache.hadoop.fs does not exist
    import org.apache.hadoop.fs.Path;
                               ^
    C:\Z\WordCount.java:7: error: package org.apache.hadoop.conf does not exist
    import org.apache.hadoop.conf.*;
    ^
    C:\Z\WordCount.java:8: error: package org.apache.hadoop.io does not exist
    import org.apache.hadoop.io.*;
    ^
    C:\Z\WordCount.java:9: error: package org.apache.hadoop.mapred does not exist
    import org.apache.hadoop.mapred.*;
    ^
    C:\Z\WordCount.java:10: error: package org.apache.hadoop.util does not exist
            import org.apache.hadoop.util.*;
            ^
    C:\Z\WordCount.java:14: error: cannot find symbol
                public static class Map extends MapReduceBase implements Mapper<Long
    Writable, Text, Text, IntWritable> {
                                                ^
      symbol:   class MapReduceBase
      location: class WordCount
    C:\Z\WordCount.java:14: error: cannot find symbol
                public static class Map extends MapReduceBase implements Mapper<Long
    Writable, Text, Text, IntWritable> {
                                                                         ^
      symbol:   class Mapper
      location: class WordCount
    C:\Z\WordCount.java:14: error: cannot find symbol
                public static class Map extends MapReduceBase implements Mapper<Long
    Writable, Text, Text, IntWritable> {
                                                                                ^

起初我试着
javac:/z/wordcount.java
然后也试过了

c:\Hadoop\hadoop-1.1.0-SNAPSHOT\bin>
    javac -classpath `C:\Hadoop\hadoop-1.1.0-SNAPSHOT\hadoop-core.jar` 
    C:\Z\WordCount.java -d C:\Z

i、 e,给出一个类路径。
我不确定javac到底指向哪里
这是我的hadoop文件夹中的内容:

01/09/2014  06:39 PM    <DIR>          .
01/09/2014  06:39 PM    <DIR>          ..
10/22/2013  01:43 PM    <DIR>          .eclipse.templates
01/09/2014  06:41 PM    <DIR>          bin
10/22/2013  01:43 PM           135,891 build.xml
10/22/2013  01:43 PM            16,372 CHANGES.branch-1-win.txt
10/22/2013  01:43 PM           463,978 CHANGES.txt
10/22/2013  01:43 PM    <DIR>          conf
10/22/2013  01:43 PM    <DIR>          contrib
10/22/2013  01:43 PM             6,843 hadoop-ant-1.1.0-SNAPSHOT.jar
10/22/2013  01:43 PM               421 hadoop-client-1.1.0-SNAPSHOT.jar
10/22/2013  01:43 PM         4,126,926 hadoop-core-1.1.0-SNAPSHOT.jar
10/22/2013  01:43 PM         4,126,926 hadoop-core.jar
10/22/2013  01:43 PM           146,277 hadoop-examples-1.1.0-SNAPSHOT.jar
10/22/2013  01:43 PM           146,277 hadoop-examples.jar
10/22/2013  01:43 PM               424 hadoop-minicluster-1.1.0-SNAPSHOT.jar
10/22/2013  01:43 PM         2,872,189 hadoop-test-1.1.0-SNAPSHOT.jar
10/22/2013  01:43 PM         2,872,189 hadoop-test.jar
10/22/2013  01:43 PM           307,933 hadoop-tools-1.1.0-SNAPSHOT.jar
10/22/2013  01:43 PM           307,933 hadoop-tools.jar
10/22/2013  01:43 PM    <DIR>          ivy
10/22/2013  01:43 PM            10,993 ivy.xml
10/22/2013  01:43 PM             6,631 Jira-Analysis.txt
01/09/2014  06:39 PM    <DIR>          lib
10/22/2013  01:43 PM    <DIR>          libexec
10/22/2013  01:43 PM            13,610 LICENSE.txt
01/15/2014  03:36 AM    <DIR>          logs
10/22/2013  01:43 PM             1,663 Monarch-CHANGES.txt
10/22/2013  01:43 PM               103 NOTICE.txt
10/22/2013  01:43 PM             2,295 README.Monarch.txt
10/22/2013  01:43 PM             1,397 README.txt
10/22/2013  01:43 PM    <DIR>          sbin
10/22/2013  01:42 PM    <DIR>          share
10/22/2013  01:43 PM    <DIR>          webapps
          21 File(s)     15,567,271 bytes
          13 Dir(s)  26,692,685,824 bytes free

请告知。

2w3kk1z5

2w3kk1z51#

尝试使用以下类路径:
-类路径%hadoop\u home%\hadoop-core-1.1.0-snapshot.jar;%hadoop\u home%\lib\commons-cli-1.2.jar

相关问题