2

I have seen this problem occuring before but I didn't find a fix for it. So I want to use proguard to try and obfuscate my files. I have set up everything using a video, however I have a problem I am fairly certain it does not have anything to do with the setup. When I hit Process! Proguard prints out the mentioned error message. I can see in the process tab and in the Input/Output tab that (I guess) ProGuard thinks rt.jar which I think stands for runtime.jar is located in the mentioned path in the title. I looked it up and it is not there. I did some research and I heard rt.jar was deleted or moved in java 9 I think. I can change the path rt.jar is supposed to be in. Where was it moved? Or was it deleted? What am I supposed to do to fix it then? I am using jdk 15.0.1 as you might've notices while reading the error message, and I am using windows 10. Thanks in advance.

2five
  • 135
  • 1
  • 2
  • 11

2 Answers2

3

Module based JDKs from 9+ do not have rt.jar. Read the manual for Proguard, which shows the -libraryjars parameter for using newer JDKs. Say you launch with:

bin\proguard.bat @file.pro

.. then depending on which JDK modules you use you'll need something like this inside your file.pro configuration:

-libraryjars  <java.home>/jmods/java.base.jmod(!**.jar;!module-info.class)
DuncG
  • 12,137
  • 2
  • 21
  • 33
1

@DuncG Thanks Just for reference I modified PMO.xml like this

<options>
   <option>
      -printconfiguration config.txt
    </option>
   <option>
      -libraryjars  &lt;java.home&gt;/jmods/java.base.jmod(!**.jar;!module-info.class)
   </option>
   <option>-keep public class my.MainClass {
        public protected *;
              }
    </option>
Asif Ashraf
  • 665
  • 1
  • 7
  • 15