简体   繁体   English

Java:Mac上的Proguard-路径

[英]java: Proguard on a mac - path

Hello fellow java developers, Java开发人员大家好,

I'm trying to obfuscate my java code, and proguard requires that i reference a java library 我正在尝试混淆我的Java代码,并且proguard要求我引用一个Java库

by default that library is rt.jar, but rt.jar does not exist in my java directory! 默认情况下,该库是rt.jar,但是rt.jar在我的java目录中不存在!

I tried referencing dt.jar, but it doesn't seem to have fixed the problem 我尝试引用dt.jar,但似乎并未解决问题

any ideas? 有任何想法吗?

rt.jar is the java runtime. rt.jar是Java运行时。 It contains all the java.* goodies that you call throughout your code. 它包含您在整个代码中调用的所有java。*好东西。 You'll find it in the directory where Java is installed. 您可以在安装Java的目录中找到它。

Edit: Doesn't exist on OS X apparently, look for classes.jar instead 编辑:显然不存在于OS X上,而是查找classes.jar

@Apple -1 for being difficult @Apple -1遇到困难

Under Mac OS X at least, the runtime is no longer packaged under rt.jar (instead it's called classes.jar). 至少在Mac OS X下,运行时不再打包在rt.jar下(而是称为classes.jar)。

You can find the location of the runtime jar by running any Java program with the VM in verbose mode and grepping for the java.lang.String class: 您可以通过在VM上以详细模式运行任何Java程序并grepping java.lang.String类来找到运行时jar的位置:

cristi:tmp diciu$ java -verbose test | grep "java.lang.String"
[Loaded java.lang.String from /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Classes/classes.jar]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM