The invention discloses a version
adaptation method and device,
electronic equipment and a storage medium, and relates to the technical field of computers.The method comprises the steps that a starting class of a current application program is loaded through a preset
first class loader, and if it is determined that the type of the current application program is a
web application program in the starting class, the current application program is started; obtaining a to-be-adapted
jar dependency file in a dependency
library directory of the current application program; unpacking the to-be-adapted
jar dependent file, and selecting a target
byte code file related to class loading; in the search class method of the
first class loader, determining a calling position for calling the target
bytecode file, and inserting a preset version
adaptation method behind the calling position; according to a version
adaptation method, performing adaptation
processing on the target
bytecode file to obtain an adapted
bytecode file; and replacing the target
byte code file by using the adapted
byte code file. By adopting the method and the device, when the adapted
byte code file is loaded, the currently running JDK version can be effectively compatible.