Question about java 18

I used java 8 for long time, and proguard work very well. In my new project, I have to upgrade java to 18. I can not found rt.jar in java 18’s lib folder. when I remove the following line from the setting file:
-libraryjars /Users/myname/Java/Java8Runtime/rt.jar

When I lauch proguard, I gotton error message:

Warning: com.firstshine.StockClient.SubGraph.GraphMoneyKline: can’t find referenced class java.lang.Class
Warning: com.firstshine.StockClient.SubGraph.GraphMoneyKline: can’t find referenced class java.lang.Integer
Warning: com.firstshine.StockClient.SubGraph.GraphMoneyKline: can’t find referenced class java.lang.Long
Warning: com.firstshine.StockClient.SubGraph.GraphMoneyKline: can’t find referenced class java.lang.String

How can I fix this error?

Hi @caizhigao ! As of Java 9, the Java libraries are distributed as jmod files. Instead of adding the rt.jar you’ll need to add the required jmods (at least java.base.jmod). For example:

-libraryjars <java.home>/jmods/java.base.jmod(!**.jar;!module-info.class)

(Taken from the config example here.)

Thank you. it works.

2 Likes