Though it\'s probably reccomended one uses and IDE for coding advanced java projects, I personally prefer running almost entirely command-line (using gedit as a text-editor)
// to create a new directory and a subfolder that will be your package
$ mkdir -p parent/child
// to move into it :
$ cd parent/child
//to create an empty java file
$ touch MyClass.java
//to edit current file
$ nano MyClass.java
package child;
public class MyClass {
}
PS: The directory structure on your computer is related to the package name. That means when you edit .java file it needs to have a package declaration(your package) otherwise you will have a default package (ex: java.util.*).