It\'s possible to add pure Java module to existing Android project.
But is it possible to create pure Java project with no Android dependencies?
Not via the 'New project' wizard.
One alternative is to create a Java maven/gradle project outside Android Studio, then 'import' it into AS via File
->Open
.
Gradle has the init
plugin to set up a java project scaffold:
gradle init --type java-library
https://docs.gradle.org/current/userguide/build_init_plugin.html
Another way from my perspective:
The easiest way to run a pure java program with input
Follow these simple steps:
A class with name Scratch.java will open now you can write your code here...
Now you can see you program output. :)