I need to deploy only the referenced classes in a very limited environment as A data carousel for Interactive TV. Bandwidth is expensive and .jar files are not supported.
我需要在非常有限的环境中部署引用的类作为交互式电视的数据轮播。带宽很昂贵,并且不支持.jar文件。
3 个解决方案
#1
Check out ProGuard which is an obfuscator that will list code and classes that are not used. Obfuscating itself usually results in a smaller foot print.
查看ProGuard,它是一个混淆器,它将列出未使用的代码和类。混淆自身通常会导致较小的足迹。
ProGuard is a free Java class file shrinker, optimizer, obfuscator, and preverifier. It detects and removes unused classes, fields, methods, and attributes. It optimizes bytecode and removes unused instructions. It renames the remaining classes, fields, and methods using short meaningless names. Finally, it preverifies the processed code for Java 6 or for Java Micro Edition.
ProGuard是一个免费的Java类文件收缩器,优化器,混淆器和预验证器。它检测并删除未使用的类,字段,方法和属性。它优化字节码并删除未使用的指令。它使用简短的无意义名称重命名剩余的类,字段和方法。最后,它预先验证了Java 6或Java Micro Edition的已处理代码。
#2
#3
Perhaps you could load a custom class loader which does support jar files or ideally pack200 files.
也许您可以加载一个自定义类加载器,它支持jar文件或理想的pack200文件。
#1
Check out ProGuard which is an obfuscator that will list code and classes that are not used. Obfuscating itself usually results in a smaller foot print.
查看ProGuard,它是一个混淆器,它将列出未使用的代码和类。混淆自身通常会导致较小的足迹。
ProGuard is a free Java class file shrinker, optimizer, obfuscator, and preverifier. It detects and removes unused classes, fields, methods, and attributes. It optimizes bytecode and removes unused instructions. It renames the remaining classes, fields, and methods using short meaningless names. Finally, it preverifies the processed code for Java 6 or for Java Micro Edition.
ProGuard是一个免费的Java类文件收缩器,优化器,混淆器和预验证器。它检测并删除未使用的类,字段,方法和属性。它优化字节码并删除未使用的指令。它使用简短的无意义名称重命名剩余的类,字段和方法。最后,它预先验证了Java 6或Java Micro Edition的已处理代码。
#2
Sounds like you need a dependency analyzer. This one might do the trick.
听起来你需要一个依赖分析器。这个可能会成功。
ProGuard might be even better, since it can also shrink existing .class files.
ProGuard可能更好,因为它也可以缩小现有的.class文件。
#3
Perhaps you could load a custom class loader which does support jar files or ideally pack200 files.
也许您可以加载一个自定义类加载器,它支持jar文件或理想的pack200文件。