Christopher Smith
Christopher Smith

Reputation: 450

ProGuard Java libraries path

I have a saved ProGuard thing, in it, I have this line:

-libraryjars /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rt.jar

I use this profile thing on both Linux and Windows. I have a portable hard drive that has this file on it and to reference libraries that I got, I can use the ../lib/aLibrary.jar. Is there a way I can get the location of rt.jar on both platforms so I don't have to change the path to the jar?

Upvotes: 2

Views: 2111

Answers (1)

Eric Lafortune
Eric Lafortune

Reputation: 45668

You could use

-libraryjars <java.home>/lib/rt.jar

ProGuard automatically replaces the Java system property java.home for you. This of course assumes that you are running ProGuard with the intended Java 7 JVM on each platform.

You could also specify your own java system property, say target.java.home:

-libraryjars <target.java.home>/lib/rt.jar

You then need to define this property on the command-line when you run ProGuard:

java -Dtarget.java.home=/usr/lib/jvm/java-7-openjdk-amd64/jre -jar lib/proguard.jar .....

Upvotes: 7

Related Questions