Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running ProGuard on OS X: Where is Apple's equivalent to the rt.jar?

I'm running ProGuard to shrink my jar file. One of the parameters it needs is the system's runtime jar. This is at $JAVA_HOME/lib/rt.jar on Sun distributions, but not on Apple's Mac OS X (v10.6 (Snow Leopard) in my case).

Is there an rt.jar for OS X?

like image 788
dacracot Avatar asked May 05 '10 20:05

dacracot


2 Answers

It is called classes.jar and it is under /System/Library/Frameworks/JavaVM.framework/Classes

Look here for details:

http://lists.apple.com/archives/java-dev/2003/Mar/msg01530.html

like image 134
Vlad Avatar answered Nov 15 '22 04:11

Vlad


This blog entry describes a relatively straight-forward way to resolve the issue without modifying the Proguard configuration.

The entry recommends that two symbolic links are created, so that rt.jar and jsse.jar exist in the path that Proguard expects them to.

Standing in the /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib directory and running the following commands resolved the problem for me:

sudo ln -s ../../Classes/classes.jar rt.jar
sudo ln -s ../../Classes/jsse.jar .
like image 12
Henrik Aasted Sørensen Avatar answered Nov 15 '22 04:11

Henrik Aasted Sørensen