简体   繁体   中英

Compiling external library as set of used classes in Java

在Netbeans中是否可以通过这种方式配置Java编译过程,即不会将整个外部库仅复制到生成的jar文件中,而是编译器将仅包括使用的类 (及其依赖项)或使用的代码块作为“内联方法” “?

I'm not sure about using NetBeans for this. It sounds like you're looking for 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.

This tool is commonly used to minimize APK size but its use is certainly not limited to Android apps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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