1. First make sure the environment variables are configured correctly.
2. Then make sure there is tools.pack and rt.pack in the directory where jdk is located, take the directory /usr/java/jdk1.8.0_221-amd64 where jdk1.8.0_221-amd64 is located as an example, make sure there is tools.pack under /usr/java/jdk1.8.0_221-amd64/lib .pack, and make sure that rt.pack is available under /usr/java/jdk1.8.0_221-amd64/jre/lib.
3. Use the tool unpack200 under /usr/java/jdk1.8.0_221-amd64/bin to extract tools.pack and rt.pack to tools.jar and rt.jar respectively,
This is done using the command line as follows.
root@iZbp1260wj4hpl4umpaodkZ:/usr/java/jdk1.8.0_221-amd64/jre/lib# …/bin/unpack200 rt.pack rt.jar
root@iZbp1260wj4hpl4umpaodkZ:/usr/java/jdk1.8.0_221-amd64/lib# …/bin/unpack200 tools.pack tools.jar