`

解决Window环境下启动Hadoop时出现的 java.lang.NoClassDefFoundError: org/apache/hadoop/util/P

阅读更多

在Window下启动Hadoop-0.21.0版本时,会出现下面这样的错误提示:

 1  java.lang.NoClassDefFoundError: org / apache / hadoop / util / PlatformName
 2  Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.util.PlatformName
 3  
 4          at java.net.URLClassLoader$ 1 .run(URLClassLoader.java: 202 )
 5          at java.security.AccessController.doPrivileged(Native Method)
 6          at java.net.URLClassLoader.findClass(URLClassLoader.java: 190 )
 7          at java.lang.ClassLoader.loadClass(ClassLoader.java: 307 )
 8          at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java: 301 )
 9          at java.lang.ClassLoader.loadClass(ClassLoader.java: 248 )
10  Could not find the main  class : org.apache.hadoop.util.PlatformName.  Program wil
11  l exit.


经过不断的查找原因和尝试,终于有了解决这个错误的办法,只需要将${HADOOP_HOME}/bin/hadoop-config.sh文件中的第190行的一下的内容

JAVA_PLATFORM = `CLASSPATH = ${CLASSPATH} ${JAVA}  - Xmx32m ${HADOOP_JAVA_PLATFORM_OPTS}  org.apache.hadoop.util.PlatformName  |  sed  - " s/ /_/g " `



修改成以下的内容即可

JAVA_PLATFORM = `CLASSPATH = ${CLASSPATH} ${JAVA}  - Xmx32m  - classpath ${HADOOP_COMMON_HOME} / hadoop - common - 0.21 . 0 .jar  org.apache.hadoop.util.PlatformName  |  sed  - " s/ /_/g " `
分享到:
评论

相关推荐

    flink依赖jar包——解决NoClassDefFoundError: com/sun/jersey

    at org.apache.hadoop.yarn.client.api.TimelineClient.createTimelineClient(TimelineClient.java:45) at org.apache.hadoop.yarn.client.api.impl.YarnClientImpl.serviceInit(YarnClientImpl.java:163) at org...

    avro-1.8.1

    运行Sqoop报错:Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/avro/LogicalType,下载此资源放到Sqoop的lib目录下即可

    flink on yarn 缺少依赖NoClassDefFoundError: com/sun/jersey

    flink-hadoop-compatibility_2.12-1.7.1.jar javax.ws.rs-api-2.0.1.jar jersey-common-2.27.jar ...Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/jersey/api/client/config/ClientConfig

    hadoop java.lang.UnsatisfiedLinkError

    解决方案:Exceptionin thread "main" java.lang.UnsatisfiedLinkError:org.apache.hadoop.util.NativeCrc32.nativeCo

    java.lang.NoClassDefFoundError错误解决办法

    "java.lang.NoClassDefFoundError错误解决办法" java.lang.NoClassDefFoundError错误是一种常见的Java错误,它发生在Java虚拟机在编译时能找到合适的类,而在运行时不能找到合适的类导致的错误。下面是该错误的解决...

    window 本地执行 hadoop 缺失的hadoop.dll 和 winutils.exe 文件

    Exception in thread "main" java.lang.UnsatisfiedLinkError:''boolean org.apache.hadoop.io.nativeio.NativeIO$Windows.access0(java.lang.String, int)' * at org.apache.hadoop.io.nativeio.NativeIO$...

    hadoop-2.6.0-hadoop.dll-winutils.exe

     at org.apache.hadoop.util.Shell.runCommand(Shell.java:482)  at org.apache.hadoop.util.Shell.run(Shell.java:455)  at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:715)  at ...

    hadoop1.0 Failed to set permissions of path 解决方案

    ERROR org.apache.hadoop.mapred.TaskTracker: Can not start task tracker because java.io.IOException: Failed to set permissions of path: \tmp\hadoop-admin \mapred\local\ttprivate to 0700 at org.apache...

    org.apache.hadoop.ipc.Client: Retrying connect to server

    NULL 博文链接:https://ouyida3.iteye.com/blog/1144326

    hadoop-3.0.0 win工具包 hadoop.dll winutils.exe

    util.Shell (Shell.java:(694)) - Did not find ...java.io.FileNotFoundException: Could not locate Hadoop executable: E:\hadoop-3.0.2\bin\winutils.exe -see https://wiki.apache.org/hadoop/WindowsProblems

    hadoop安装包下载地址

    ### Hadoop安装包下载地址详解 #### Hadoop简介与下载指南 Hadoop是一款开源软件框架,主要用于分布式存储和处理大规模数据集。它基于Google的MapReduce论文和其他相关论文设计而成,能够有效地支持海量数据的存储...

    hadoop常见问题及解决办法

    Hadoop常见问题及解决办法汇总 Hadoop是一个基于Apache的开源大数据处理框架,广泛应用于大数据处理、数据分析和机器学习等领域。然而,在使用Hadoop时,经常会遇到一些常见的问题,这些问题可能会导致Hadoop集群...

    java. lang . UnsatisfiedLinkError: org. apache . hadoop. io. nativeio. NativeIOSWindows . access0

     hadoop. io. nativeio. NativeIOSWindows . access0 (Ijava/ lang/String;I)Z  原因:在调用NativeIO中的access0()时调不到 解决方法:①第一步:在项目工程中加入NativelO.java,注意包名必须与源码中...

    hadoop安装与配置 Hadoop的安装与配置可以分成几个主要步骤: 1. 安装Java 2. 下载Hadoop 3. 配

    wget https://archive.apache.org/dist/hadoop/core/hadoop-2.7.7/hadoop-2.7.7.tar.gz tar -xzf hadoop-2.7.7.tar.gz sudo mv hadoop-2.7.7 /usr/local/hadoop 3. 配置Hadoop 编辑/usr/local/hadoop/etc/hadoop/...

    hadoop.dll

    at org.apache.hadoop.util.Shell.runCommand(Shell.java:482) 2:window10操作系统下面。hadoop-2.6.4版本,解决上面这个问题的必须两个文件。详细见博客:http://www.cnblogs.com/biehongli/p/7895857.html 3:...

    java-json.7z

    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70) at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183) at org.apache.sqoop.Sqoop.runTool(Sqoop.java:234) at org.apache.sqoop.Sqoop.runTool...

    hadoop0.23.9离线api

    org.apache.hadoop.lib.lang org.apache.hadoop.lib.server org.apache.hadoop.lib.service org.apache.hadoop.lib.service.hadoop org.apache.hadoop.lib.service.instrumentation org.apache.hadoop.lib....

Global site tag (gtag.js) - Google Analytics