title: Using Proguard in Gradle - can't find referenced class java.lang.String
body: <p>I'm trying to configure ProGuard as part of my Gradle build scripts for a java application in Ubuntu, accessed through bash, but I can't seem to get it right.  I've never used either technology before.  Using the <a href="http://proguard.sourceforge.net/index.html#manual/gradle.html" rel="noreferrer">ProGuard Manual</a> I wrote the following task, which I currently call on a pre-existing jar file while I try and get something working.</p>
  
  <pre><code>task obfuscate(type: proguard.gradle.ProGuardTask) {
    injars         'build/libs/myapplication.jar'
    outjars        'build/libs/myapplication_out.jar'
    libraryjars    '&lt;java.home&gt;/lib/rt.jar'
    printmapping   'myapplication.map'
  
    keep 'public class mypackage.MyMainClass {  \
      public static void main(java.lang.String[]);  \
    }'
  }
  </code></pre>
  
  <p>I get back a lot of lines stating missing built in java library files such as:</p>
  
  <pre><code>Warning: myclasses: can't find referenced class java.lang.String
  </code></pre>
  
  <p>At the bottom of the list I also see:</p>
  
  <pre><code>Could not call ProGuardTask.proguard()
  </code></pre>
  
  <p>If I check my output directory, I can see it created the directory structure but not the jar file and this is what I see if I run my gradle task with stacktrace on:</p>
  
  <pre><code>Caused by: org.gradle.api.GradleException: Could not call ProGuardTask.proguard() on task
  </code></pre>
  
  <p>I had a look on the proguard trouble shooting page and it said that I should make sure I'm specifying the run-time library of my platform and that for JSE this is lib/rt.jar.  You can see that up there in the library jars argument.  What have I missunderstood?</p>