Package org.apache.hadoop.fs does not exist

Firstly, I KNOW THIS HAPPENED BEFORE, but none of the solutions work for me, and I would like to know why.

I am trying to compile the standard "WordCount.java" .jar for hasoop in my single-node linux server, but keep getting package org.apache.hadoop.* does not exist error.

I know that I need to edit $ CLASSPATH, but everything I found online references the hadoop-core link, and I cannot find hadoop-core anywhere in my build (2.4.0). How to find where org.apache.hadoop. * Will exist on my system?

I believe that this would be a good "general" answer, since I saw a lot of questions about this, and each one gives a specific path / path / path / classpath /, but it (apparently) differs depending on the version and build of hadoop .

+5
source share
1 answer

As you said, the required CLASSPATH depends on the version, location, and type of installation. How to install it, this is a separate discussion, but provided that you had the correct settings for hadoop installed, it is easy (although I admit that I do not know where this is documented).

Hadoop provides a convenient utility for obtaining the necessary CLASSPATH information. Run this

 bin/hadoop classpath 

This should provide you with the information you need to configure your class, to compile your code.

+17
source

Source: https://habr.com/ru/post/1206122/


All Articles