downgrade java version on archlinux

610 Views Asked by At

I have just updated java on my archlinux server and now it mess up my tomcat projects.

I want to downgrade java from 11.0.17.u1 to 11.0.13.u8

I looked at my var/cache/pacman/pkg folder and it seems like my old package are still there

jre11-openjdk-11.0.13.u8-1-x86_64.pkg.tar.zst 

jre11-openjdk-headless-11.0.13.u8-1-x86_64.pkg.tar.zst

I am trying to run this command to force the installation of this java version :

sudo pacman -U jre11-openjdk-11.0.13.u8-1-x86_64.pkg.tar.zst

But it does not let me and I get this message :

loading packages...
warning: downgrading package jre11-openjdk (11.0.17.u1-1 => 11.0.13.u8-1)
resolving dependencies...
warning: cannot resolve "jre11-openjdk-headless=11.0.13.u8-1", a dependency of "jre11-openjdk"
:: The following package cannot be upgraded due to unresolvable dependencies:
      jre11-openjdk

What can I do to force the downgrade?


Further infos:

This is the error I am getting since I updated the JVM

09-Jan-2023 15:46:44.910 WARNING [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesObjectStreamClassCaches Failed to clear soft references from ObjectStreamClass$Caches for web application [docs]
    java.lang.ClassCastException: class java.io.ObjectStreamClass$Caches$1 cannot be cast to class java.util.Map (java.io.ObjectStreamClass$Caches$1 and java.util.Map are in module java.base of loader 'bootstrap')

The tomcat servers I have not restarted yet (which are still running under the old jvm are doing just fine.

I found this topic here :

ClassCastException when stopping Tomcat 10 inside Eclipse

The solution that is brought is to upgrade the tomcat version. I am in an emergency situation where I don't have the time to update all my tomcat servers right now.

1

There are 1 best solutions below

0
On

The error,

WARNING [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesObjectStreamClassCaches Failed to clear soft references from ObjectStreamClass$Caches for web application [docs] java.lang.ClassCastException: class java.io.ObjectStreamClass$Caches$1 cannot be cast to class java.util.Map (java.io.ObjectStreamClass$Caches$1 and java.util.Map are in module java.base of loader 'bootstrap')

appears to be a bug in certain openjdk versions, and can be ignored.

According to this tomcat thread, tomcat versions >= 9.0.64 automatically suppress this error message.

In my case, I wasn't in a position to upgrade tomcat immediately, but you tell tomcat to suppress the message by adding the following to the context.xml file, either within the web application context.xml or the global context.xml. I chose to update the global context.xml.

<Context clearReferencesObjectStreamClassCaches="false">