Thursday, November 12, 2009

Missing rt.jar Mac OS X using ProGuard with NetBeans

When you are using ProGuard for obfuscation of some of your NetBeans module code on a Mac running OS X and you will most likely refer to rt.jar in your build.xml and get and error about missing rt.jar.

One quick fix solving this could be the following which helped me.

On your Mac open a terminal and change directory to


now just softlink to classes.jar via

me$ sudo ln -s ../../Classes/classes.jar rt.jar


  1. Brilliant! Thanks and you!

  2. Hi,

    I have this with the Lion 10.7.3 jdk 1.6.0

    $ls -l rt.jar
    lrwxr-xr-x 1 root wheel 25B Mar 14 23:18 rt.jar -> ../../Classes/classes.jar
    $ls -l
    total 8
    lrwxr-xr-x 1 root wheel 16B Mar 14 23:20 rt.jar -> ../../lib/rt.jar

    Thanks again for this nice post....

    1. Thanx. Do I read this that you simply created 2 softlinks on 10.7.3 with jdk 1.6.0 to support both jdk and jre consumption ?

  3. Hi,
    Thanks for this workaround! I'm using:
    Darwin ArjonesBook.local 11.4.0 Darwin Kernel Version 11.4.0: Mon Apr 9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64 x86_64

    And besides the SYMLINK you described, on my env I had to create a ref. to jre. see commands below.

    Hope it can be useful!

    cd /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
    sudo ln -s /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar rt.jar

    cd /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
    sudo ln -s . jre

  4. What version of ProGuard are you guy's using ? I am planning to upgrade to 4.9 as I switch to Java 7.

  5. hi...Im student from Informatics engineering nice article,
    thanks for sharing :)

  6. nice solution. thanks.

  7. Interesting to get comments on this blog even 6 years after I wrote it. Happy that this helped so many of you and thanx for the nice words.