原文链接:http://www.blogjava.net/snoics/archive/2010/10/10/333408.html
在Window下启动Hadoop-0.21.0版本时,会出现下面这样的错误提示:
java.lang.NoClassDefFoundError: org/apache/hadoop/util/PlatformName
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.util.PlatformName
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: org.apache.hadoop.util.PlatformName. Program will exit.
经过不断的查找原因和尝试,终于有了解决这个错误的办法,只需要将${HADOOP_HOME}/bin/hadoop-config.sh文件中的第190行的一下的内容:
JAVA_PLATFORM=`CLASSPATH=${CLASSPATH} ${JAVA} -Xmx32m ${HADOOP_JAVA_PLATFORM_OPTS} org.apache.hadoop.util.PlatformName | sed -e "s/ /_/g"`
修改成以下的内容即可:
JAVA_PLATFORM=`CLASSPATH=${CLASSPATH} ${JAVA} -Xmx32m -classpath ${HADOOP_COMMON_HOME}/hadoop-common-0.21.0.jar org.apache.hadoop.util.PlatformName | sed -e "s/ /_/g"`
分享到:
相关推荐
解决方案:Exceptionin thread "main" java.lang.UnsatisfiedLinkError:org.apache.hadoop.util.NativeCrc32.nativeCo
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...
运行Sqoop报错:Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/avro/LogicalType,下载此资源放到Sqoop的lib目录下即可
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$...
"java.lang.NoClassDefFoundError错误解决办法" java.lang.NoClassDefFoundError错误是一种常见的Java错误,它发生在Java虚拟机在编译时能找到合适的类,而在运行时不能找到合适的类导致的错误。下面是该错误的解决...
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....
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 ...
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...
Java-org.apache.hadoop是Apache Hadoop项目的核心组件,它在分布式计算领域扮演着至关重要的角色。Hadoop是由Apache软件基金会开发的一个开源框架,主要用于处理和存储大量数据。它设计的初衷是为了支持数据密集型...
`Exception in thread "main" java.lang.NoClassDefFoundError` 是Java编程中常见的一个运行时异常,通常发生在尝试运行一个Java程序时,如果JVM找不到在类路径(ClassPath)中定义的主要类(主类,即包含`public ...
包org.apache.hadoop.mapreduce的Hadoop源代码分析
hadoop. io. nativeio. NativeIOSWindows . access0 (Ijava/ lang/String;I)Z 原因:在调用NativeIO中的access0()时调不到 解决方法:①第一步:在项目工程中加入NativelO.java,注意包名必须与源码中...
org.apache.hadoop.io.nativeio.NativeIO$Windows.createDirectoryWithMode0(Ljava/lang/String;I)V 解决方案:下载本资源解压将hadoop.dll和winutils.exe文件复制到hadoop2.7.3的bin目录下即可解决。
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
该wintuils合集包含hadoop2.6.0、2.6.3、2.6.4、2.7.1、2.8.0、2.8.3、3.0.0版本,请需要的小伙伴们前来下载,用以解决本地测试报错...(将bin文件放到/hadoop/下,hadoop.dll和wintuils.exe放到/windows/system32/下)
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:...
Hive错误之 Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask错误分析_xiaohu21的博客-CSDN博客.mht
at org.apache.hadoop.util.Shell.getQualifiedBinPath(Shell.java:378) at org.apache.hadoop.util.Shell.getWinUtilsPath(Shell.java:393) at org.apache.hadoop.util.Shell.(Shell.java:386) at org.apache....