简体   繁体   中英

How to use selected .class from .jar

I am developing an API(.jar) to be used with Android App, I have constrain on size of .jar file after build.

I am using several dependent libraries(.jar) files, but not completely; hardly 5-6 class files from 200.

How can I use the selected .class files from libraries and dependent .class files?

Proguard automatically does this. Configure proguard via Gradle: http://proguard.sourceforge.net/manual/gradle.html

I'm not quite sure if this is what you are looking for but you can use -cp to run a specific class in your jar file

example:

java -cp myjar.jar package1.class1

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