Is it possible to compile a simple Java code in Android Studio? -


this question has answer here:

i have android studio, not eclipse.

do have install eclipse in order test simple java code? or possible using android studio?

what difference between both?

the cool thing android studio delegates build process gradle. , gradle, building plain java application matter of adding necessary plugin build.gradle file.

apply plugin: 'application'  mainclassname = "com.your.package.mainclassname" 

and don't need go through new project wizard. make project directory, create build.gradle file in script above. put java source code in 'src/main/java'.

in android studio click 'import project (eclipse, gradle, etc.)', open project directory , select build.gradle file. choose ok configure gradle wrapper. when import finished press run , let plugin rest.

note, 'application' plugin implicitly applies java plugin.

more these plugins here: https://docs.gradle.org/current/userguide/application_plugin.html , here: https://docs.gradle.org/current/userguide/java_plugin.html


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -