编译 Hadoop WordCount MapReduce 示例时出错

问题描述

在尝试编译 here 提供的 WordCount.java 源代码时,我始终遇到相同的两个错误。我正在使用 Ubuntu Linux。我进行了大量搜索,每个人似乎都得出结论,如下更改 HADOOP_CLASSPATH 环境变量应该可以解决问题,但我仍然收到错误消息。我还在 haddop_env.sh 文件中包含了这些环境变量定义。

{% load static %}

{% block content %}

    {% include 'main/navbar.html' %}
    {% include 'main/sidenav.html' %}

<main>
    <div class="container-fluid">
        <h1 class="mt-4">Modules</h1>
        <ol class="breadcrumb mb-4">
            <div id="total_modules">
            {% include 'main/total_modules.html' %}
            </div>
        </ol>


        <div class="card mb-4">

            <div class="card-header">
                <div class="row">
                <button type="button" class="btn btn-success show-form">Add Module</button>
                    <a class="col-xl-1"></a>
                <button type="button" class="col-xl-1 btn btn-success btn-block show-test-form">New Test</button>
            </div>
        </div>
            <div class="card-body">
                <div>
                    <table id="dataTable" width="100%" class="display nowrap table-bordered table-striped" >
                        <thead>
                            <tr>
                                <th>Car</th>
                                <th>Serial Number</th>
                                <th>Date</th>
                                <th>Batch</th>
                                <th>Status</th>
                                <th>Last Test</th>
                                <th>Details</th>
                                <th>Added</th>
                            </tr>
                        </thead>
                        <tbody>
                            {% for module in modules_list %}
                                {% with latest_test=module.get_latest_test %}
                                <tr>
                                    <td>{{ module.car }}</td>
                                    <td>{{ module.serial_number }}</td>
                                    <td>{{ module.day }} {{ module.mon }} {{ module.year1 }}</td>
                                    <td>{{ module.batch }}</td>
                                    <td>{{ latest_test.cap|stringformat:".2f" }} %</td>
                                    <td>{{ latest_test.added_at|date:'d M Y H:i' }}</td>

                                    <td><a style="font-weight: bolder;" class="btn btn-secondary" href="{% url 'module_details' module.pk %}">Details</a> </td>
                                    <td>{{ module.added_at|date:'d M Y H:i' }}</td>
                                </tr>
                                {% endwith %}
                            {% endfor %}
                        </tbody>
                    </table>
                    <div>

                    </div>
                <div class="modal fade" id="modal-book" data-backdrop="static" data-keboard="false">
                    <div class="modal-dialog">
                        <div class="modal-content"></div>
                    </div>
                </div>
                    <div class="modal fade" id="modal-test" data-backdrop="static" data-keboard="false">
                    <div class="modal-dialog">
                        <div class="modal-content"></div>
                    </div>
                </div>
                </div>
            </div>
        </div>
    </div>
</main>


    {% include 'main/footer.html' %}

{% endblock %}

然而,即使设置了这些变量,我在运行以下编译命令后仍然出现以下两个错误:

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=${JAVA_HOME}/bin:${PATH}
export HADOOP_CLASSPATH=${JAVA_HOME}/lib/tools.jar

我得到了错误:

bin/hadoop com.sun.tools.javac.Main WordCount.java

如果您有任何见解,我将不胜感激。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)