How Can I Use JLink with AppCDS

cstack :

We are using JLink to create our own jre. While trying to port to java 13 I wanted to take advantage of the new AppCDS changes. The first error I'm hitting is that jlink does not copy over the classes.jsa.

If I manually copy over classes.jsa, I get a different error: A jar file is not the one used while building the shared archive file.

I assume they are both rooted in the fact that I'm not linking in the right module for appCDS. However I can't find any documentation on what that module is. Does anyone have any clues?

cstack :

I had to pause on Java 13 for a bit, but got back to it today. I was able to fix it by running java -Xshare:dump from my jlinked jre. This created the classes.jsa file it was expecting and from there I was able to use ArchiveClassesAtExit and SharedArchiveFile.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=166083&siteId=1