clearClassCache script

When the cache is corrupted or when the cache is still holding previous versions of classes after an update, clearing the class cache might be needed. Use the clearClassCache script to clear the Java™ virtual machine (JVM) class cache.

Run the clearClassCache script on the command line from the WAS_HOME/bin or the user_install_root/bin directory.

Avoid trouble: Before you run the clearClassCache script, note the following conditions:
  • All servers that use the same Java version and use the same shared class cache must be stopped before you run the clearClassCache script.
  • The server can have problems when it reads or updates the cache after the clearClassCache script finishes on a server that is active.
  • You must be logged in as the user who started WebSphere® Application Server.
If the log file indicates that the clearClassCache script failed, you can manually clear the class cache by directly deleting the contents of the cache directory. The default path to use for the cache directory on the file system is the following:
  • [Windows]The directory is the user's C:\Users\<username>\AppData\Local\javasharedresources directory.
  • On other operating systems, the directory is javasharedresources in the user's home directory.

Syntax

The syntax for this script is as follows:

[Linux][AIX]
clearClassCache.sh
[Windows]
clearClassCache.bat

Usage scenario

To clear the class cache, run the clearClassCache script as follows:

[Linux][AIX]
./clearClassCache.sh
[Windows]
clearClassCache.bat
The result of the clearClassCache script is a log message that is written to the clearClassCache.log file in one of the following locations:
  • WAS_HOME/logs/clearClassCache.log file if you ran the clearClassCache script from the WAS_HOME/bin directory.
  • user_install_root/logs/clearClassCache.log file if you ran the clearClassCache script from the user_install_root/bin directory.