Monday, March 6, 2023

java.lang.UnsupportedClassVersionError: com/dom/benchmarking/swingbench/SwingBench

 java.lang.UnsupportedClassVersionError:



[oracle@10.1.0.2 bin]$

[oracle@10.1.0.2 bin]$ ./swingbench

java.lang.UnsupportedClassVersionError: com/dom/benchmarking/swingbench/SwingBench has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0

        at java.lang.ClassLoader.defineClass1(Native Method)

        at java.lang.ClassLoader.defineClass(ClassLoader.java:756)

        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)

        at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)

        at java.net.URLClassLoader.access$100(URLClassLoader.java:74)

        at java.net.URLClassLoader$1.run(URLClassLoader.java:369)

        at java.net.URLClassLoader$1.run(URLClassLoader.java:363)

        at java.security.AccessController.doPrivileged(Native Method)

        at java.net.URLClassLoader.findClass(URLClassLoader.java:362)

        at java.lang.ClassLoader.loadClass(ClassLoader.java:418)

        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)

        at java.lang.ClassLoader.loadClass(ClassLoader.java:351)

        at java.lang.Class.forName0(Native Method)

        at java.lang.Class.forName(Class.java:264)

        at org.apache.commons.launcher.ChildMain.run(ChildMain.java:183)

[oracle@10.1.0.2 bin]$

[oracle@10.1.0.2 bin]$

[oracle@10.1.0.2 bin]$




[root@10.1.0.2 ~]#

[root@10.1.0.2 ~]# wget https://download.oracle.com/java/19/latest/jdk-19_linux-x64_bin.rpm

--2023-03-06 14:49:06--  https://download.oracle.com/java/19/latest/jdk-19_linux-x64_bin.rpm

Resolving download.oracle.com (download.oracle.com)... 23.56.12.90

Connecting to download.oracle.com (download.oracle.com)|23.56.12.90|:443... connected.

HTTP request sent, awaiting response... 200 OK

Length: 189609546 (181M) [application/x-redhat-package-manager]

Saving to: ‘jdk-19_linux-x64_bin.rpm’


jdk-19_linux-x64_bin.rpm       100%[==================================================>] 180.83M  99.6MB/s    in 1.8s


2023-03-06 14:49:08 (99.6 MB/s) - ‘jdk-19_linux-x64_bin.rpm’ saved [189609546/189609546]


[root@10.1.0.2 ~]#

[root@10.1.0.2 ~]#

[root@10.1.0.2 ~]#

[root@10.1.0.2 ~]# ls -lrt

total 260760

-rw-------. 1 root root      6699 May  4  2021  original-ks.cfg

-rw-------. 1 root root      6953 May  4  2021  anaconda-ks.cfg

-rw-r--r--  1 root root 189609546 Dec  7 23:14  jdk-19_linux-x64_bin.rpm

-rw-r--r--  1 root root  77218345 Jan  9 18:30 'AutoDL?BundleId=247937_0ae14417abb444ebb02b9815e2103550'

-rw-r--r--  1 root root     25289 Feb  6 10:25  aws-replication-installer-init.py

drwxr-xr-x  3 root root       105 Feb 18 13:01  mgn18022023

-rw-r--r--  1 root root    137320 Feb 18 13:07  aws_replication_agent_installer.log

[root@10.1.0.2 ~]#

[root@10.1.0.2 ~]#

[root@10.1.0.2 ~]# rpm -Uvh jdk-19_linux-x64_bin.rpm

warning: jdk-19_linux-x64_bin.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY

Verifying...                          ################################# [100%]

Preparing...                          ################################# [100%]

Updating / installing...

   1:jdk-19-2000:19.0.2-7             ################################# [100%]

[root@10.1.0.2 ~]#

[root@10.1.0.2 ~]#

[root@10.1.0.2 ~]#

[root@10.1.0.2 ~]#

[root@10.1.0.2 ~]# which java

/usr/bin/java

[root@10.1.0.2 ~]#

[root@10.1.0.2 ~]#

[root@10.1.0.2 ~]# java -version

java version "19.0.2" 2023-01-17

Java(TM) SE Runtime Environment (build 19.0.2+7-44)

Java HotSpot(TM) 64-Bit Server VM (build 19.0.2+7-44, mixed mode, sharing)

[root@10.1.0.2 ~]#

[root@10.1.0.2 ~]#



workaround :

 We have to install compatible java version so that application software (swingbench)  run

1 comment: