简体   繁体   中英

android studio 3.5: can I export run configuration to jar?

In Ecliplse we could export executable jar from any class with static main() method. I've made a lot of utilities that way, using main app engine in-place. But in Android Studio 3.5 I didn't found an easy way to do the same. Does it exist? As a temporary solution I use Application target (in Run configurations) and it works the same, but how to export it as jar?

Yes, it is possible you can just go to File -> New -> New Module

then select Java Library, choose a name and hit finish.

Then you will see a new Module in your Project View.

You can then go to your Gradle View and go under YOUR NEW CREATED MODULE -> Tasks -> build and then just double click on build.

Then it should have generated a .jar file which you can easily search in Windows Explorer for just go to your Project Path \\ YOUR NEW CREATED MODULE \\ build\\libs

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