我成功安装了 Hadoop,它工作正常,但是当我安装 Hive 并hive
在终端中运行命令时,我收到了这个错误
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 64
at java.util.jar.JarFile.match(java.base@9-internal/JarFile.java:983)
at java.util.jar.JarFile.checkForSpecialAttributes(java.base@9-internal/JarFile.java:1017)
at java.util.jar.JarFile.isMultiRelease(java.base@9-internal/JarFile.java:399)
at java.util.jar.JarFile.getEntry(java.base@9-internal/JarFile.java:524)
at java.util.jar.JarFile.getJarEntry(java.base@9-internal/JarFile.java:480)
at jdk.internal.util.jar.JarIndex.getJarIndex(java.base@9-internal/JarIndex.java:114)
at jdk.internal.loader.URLClassPath$JarLoader$1.run(java.base@9-internal/URLClassPath.java:640)
at jdk.internal.loader.URLClassPath$JarLoader$1.run(java.base@9-internal/URLClassPath.java:632)
at java.security.AccessController.doPrivileged(java.base@9-internal/Native Method)
at jdk.internal.loader.URLClassPath$JarLoader.ensureOpen(java.base@9-internal/URLClassPath.java:631)
at jdk.internal.loader.URLClassPath$JarLoader.<init>(java.base@9-internal/URLClassPath.java:606)
at jdk.internal.loader.URLClassPath$3.run(java.base@9-internal/URLClassPath.java:386)
at jdk.internal.loader.URLClassPath$3.run(java.base@9-internal/URLClassPath.java:376)
at java.security.AccessController.doPrivileged(java.base@9-internal/Native Method)
at jdk.internal.loader.URLClassPath.getLoader(java.base@9-internal/URLClassPath.java:375)
at jdk.internal.loader.URLClassPath.getLoader(java.base@9-internal/URLClassPath.java:352)
at jdk.internal.loader.URLClassPath.getResource(java.base@9-internal/URLClassPath.java:218)
at jdk.internal.loader.BuiltinClassLoader$3.run(java.base@9-internal/BuiltinClassLoader.java:463)
at jdk.internal.loader.BuiltinClassLoader$3.run(java.base@9-internal/BuiltinClassLoader.java:460)
at java.security.AccessController.doPrivileged(java.base@9-internal/Native Method)
at jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(java.base@9-internal/BuiltinClassLoader.java:459)
at jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(java.base@9-internal/BuiltinClassLoader.java:406)
at jdk.internal.loader.BuiltinClassLoader.loadClass(java.base@9-internal/BuiltinClassLoader.java:364)
at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(java.base@9-internal/ClassLoaders.java:184)
at java.lang.ClassLoader.loadClass(java.base@9-internal/ClassLoader.java:419)
at sun.launcher.LauncherHelper.loadMainClass(java.base@9-internal/LauncherHelper.java:585)
at sun.launcher.LauncherHelper.checkAndLoadMain(java.base@9-internal/LauncherHelper.java:497)
Unable to determine Hadoop version information.
'hadoop version' returned:
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 64
at java.util.jar.JarFile.match(java.base@9-internal/JarFile.java:983)
at java.util.jar.JarFile.checkForSpecialAttributes(java.base@9-internal/JarFile.java:1017)
at java.util.jar.JarFile.isMultiRelease(java.base@9-internal/JarFile.java:399)
at java.util.jar.JarFile.getEntry(java.base@9-internal/JarFile.java:524)
at java.util.jar.JarFile.getJarEntry(java.base@9-internal/JarFile.java:480)
at jdk.internal.util.jar.JarIndex.getJarIndex(java.base@9-internal/JarIndex.java:114)
at jdk.internal.loader.URLClassPath$JarLoader$1.run(java.base@9-internal/URLClassPath.java:640)
at jdk.internal.loader.URLClassPath$JarLoader$1.run(java.base@9-internal/URLClassPath.java:632)
at java.security.AccessController.doPrivileged(java.base@9-internal/Native Method)
at jdk.internal.loader.URLClassPath$JarLoader.ensureOpen(java.base@9-internal/URLClassPath.java:631)
at jdk.internal.loader.URLClassPath$JarLoader.<init>(java.base@9-internal/URLClassPath.java:606)
at jdk.internal.loader.URLClassPath$3.run(java.base@9-internal/URLClassPath.java:386)
at jdk.internal.loader.URLClassPath$3.run(java.base@9-internal/URLClassPath.java:376)
at java.security.AccessController.doPrivileged(java.base@9-internal/Native Method)
at jdk.internal.loader.URLClassPath.getLoader(java.base@9-internal/URLClassPath.java:375)
at jdk.internal.loader.URLClassPath.getLoader(java.base@9-internal/URLClassPath.java:352)
at jdk.internal.loader.URLClassPath.getResource(java.base@9-internal/URLClassPath.java:218)
at jdk.internal.loader.BuiltinClassLoader$3.run(java.base@9-internal/BuiltinClassLoader.java:463)
at jdk.internal.loader.BuiltinClassLoader$3.run(java.base@9-internal/BuiltinClassLoader.java:460)
at java.security.AccessController.doPrivileged(java.base@9-internal/Native Method)
at jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(java.base@9-internal/BuiltinClassLoader.java:459)
at jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(java.base@9-internal/BuiltinClassLoader.java:406)
at jdk.internal.loader.BuiltinClassLoader.loadClass(java.base@9-internal/BuiltinClassLoader.java:364)
at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(java.base@9-internal/ClassLoaders.java:184)
at java.lang.ClassLoader.loadClass(java.base@9-internal/ClassLoader.java:419)
at sun.launcher.LauncherHelper.loadMainClass(java.base@9-internal/LauncherHelper.java:585)
at sun.launcher.LauncherHelper.checkAndLoadMain(java.base@9-internal/LauncherHelper.java:497)
我的.bashrc
文件是:
#Hadoop variables
export JAVA_HOME=/usr/lib/jvm/java-9-openjdk-amd64
export HADOOP_INSTALL=/usr/local/hadoop
export HADOOP_HOME=/usr/local/hadoop
export PATH=$PATH:$HADOOP_INSTALL/bin
export PATH=$PATH:$HADOOP_INSTALL/sbin
export HADOOP_MAPRED_HOME=$HADOOP_INSTALL
export HADOOP_COMMON_HOME=$HADOOP_INSTALL
export HADOOP_HDFS_HOME=$HADOOP_INSTALL
export YARN_HOME=$HADOOP_INSTALL
#end of Hadoop variable declaration
#HIVE variables
export HIVE_HOME=/usr/lib/hive
export HIVE_CONF_DIR=/usr/lib/hive/conf
export PATH=$PATH:$HIVE_HOME/bin
export CLASSPATH=$CLASSPATH:/usr/local/hadoop/lib/*:
export CLASSPATH=$CLASSPATH:/usr/local/hive/lib/*:
我已经坚持了一周,找不到有效的解决方案。