Search for getting started with Java programming through cmd. You need to download Java SDK for it and then there are a few steps which you can easily find by searching on Google.
Yes we can create a Java project from command line using maven. Download Maven and install it. Then choose the type of Java Project to create and run the respective command. It creates an empty Java project. You can now start creating classes and work on.
For reference: http://javabrains.koushik.org/maven.html