https://hive.apache.org/docs/latest/admin/adminmanual-installation/
frank@ZZHPC:~/download$ wget https://dlcdn.apache.org/hive/hive-4.2.0/apache-hive-4.2.0-bin.tar.gz frank@ZZHPC:~/download$ tar -xzf apache-hive-4.2.0-bin.tar.gz
frank@ZZHPC:~/download$ mv apache-hive-4.2.0-bin apache-hive-4.2.0
.bashrc:
export HIVE_HOME=~/download/apache-hive-4.2.0 PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$HIVE_HOME/bin export PATH
Hive CLI and Beeline CLI
frank@ZZHPC:~$ hive SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/home/frank/download/apache-hive-4.2.0/lib/log4j-slf4j-impl-2.24.3.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/home/frank/download/hadoop-3.4.2/share/hadoop/common/lib/slf4j-reload4j-1.7.36.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory] SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/home/frank/download/apache-hive-4.2.0/lib/log4j-slf4j-impl-2.24.3.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/home/frank/download/hadoop-3.4.2/share/hadoop/common/lib/slf4j-reload4j-1.7.36.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory] Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/hive/beeline/BeeLine has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 61.0 at java.base/java.lang.ClassLoader.defineClass1(Native Method) at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017) at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150) at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862) at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760) at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681) at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:579) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:469) at org.apache.hadoop.util.RunJar.run(RunJar.java:326) at org.apache.hadoop.util.RunJar.main(RunJar.java:254)
It looks like you've run into a classic Java version mismatch.
The specific error java.lang.UnsupportedClassVersionError means that your Hive binaries were compiled with a newer version of Java than the one you are currently using to run them.
The Breakdown
-
Class file version 65.0: This corresponds to Java 21. Your Hive 4.2.0 installation was built using Java 21.
-
Class file version 61.0: This corresponds to Java 17. Your current system is running Java 17.
In the Java world, you can run old code on a new JVM, but you cannot run new code (Java 21) on an old JVM (Java 17).
How to Fix It
Option 1: Upgrade your Java (Recommended)
Since you are using modern versions of Hive (4.2.0) and Hadoop (3.4.2), upgrading your system to JDK 21 is the cleanest solution.
-
Install OpenJDK 21:
sudo apt update sudo apt install openjdk-21-jdk -
Update your
JAVA_HOME: Edit your~/.bashrcor~/.profileand pointJAVA_HOMEto the new version:export JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64 export PATH=$JAVA_HOME/bin:$PATH -
Source the file:
source ~/.bashrc
frank@ZZHPC:~$ hive SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/home/frank/download/apache-hive-4.2.0/lib/log4j-slf4j-impl-2.24.3.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/home/frank/download/hadoop-3.4.2/share/hadoop/common/lib/slf4j-reload4j-1.7.36.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory] SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/home/frank/download/apache-hive-4.2.0/lib/log4j-slf4j-impl-2.24.3.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/home/frank/download/hadoop-3.4.2/share/hadoop/common/lib/slf4j-reload4j-1.7.36.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory] Beeline version 4.2.0 by Apache Hive beeline>
beeline> !q
frank@ZZHPC:~$ mv /home/frank/download/apache-hive-4.2.0/lib/log4j-slf4j-impl-2.24.3.jar /home/frank/download/apache-hive-4.2.0/lib/log4j-slf4j-impl-2.24.3.jar.bak
frank@ZZHPC:~$ hive Beeline version 4.2.0 by Apache Hive beeline>
frank@ZZHPC:~$ beeline Beeline version 2.3.9 by Apache Hive beeline>
Hive Metastore
Metadata is stored in an embedded Derby database whose disk storage location is determined by the Hive configuration variable named javax.jdo.option.ConnectionURL. By default, this location is ./metastore_db (see conf/hive-default.xml).
Using Derby in embedded mode allows at most one user at a time. To configure Derby to run in server mode, see Hive Using Derby in Server Mode.
To configure a database other than Derby for the Hive metastore, see Hive Metastore Administration.
Next Step: Configuring Hive.
HCatalog and WebHCat
HCatalog
Version
HCatalog is installed with Hive, starting with Hive release 0.11.0.
If you install Hive from the binary tarball, the hcat command is available in the hcatalog/bin directory. However, most hcat commands can be issued as hive commands except for “hcat -g” and “hcat -p”. Note that the hcat command uses the -p flag for permissions but hive uses it to specify a port number. The HCatalog CLI is documented here and the Hive CLI is documented here.
HCatalog installation is documented here.
WebHCat (Templeton)
Version
WebHCat is installed with Hive, starting with Hive release 0.11.0.
If you install Hive from the binary tarball, the WebHCat server command webhcat_server.sh is in the hcatalog/sbin directory.
WebHCat installation is documented here.

浙公网安备 33010602011771号