Example, in what follows.Example, create two subfolders (subdirectories), call one src and the other class. In src you will place the source code you write, and the compiled versions of this will go in class.src. Make sure you save them as text (txt) files, and make sure they have a file type of java.Example/src. Remember, you do this using cd. Typing cd .. moves up one level, and typing cd Name moves you down one level, into the subdirectory Name. At any point, the command dir (ls in Linux) will show the contents of the current working directory.Example/src, compile what you typed. For this, enter
javac -d ../class *.java
javac is the compile command. The -d specifies the directory in which the compiled code will go. The part ../class specifies that this directory should be the class directory (it moves the working directory from src, up one level, then down into class). Finally, *.java says you want everything in src whose file type is java to be compiled.class, by typing
cd ../classjava Something, where Something is the class you defined having main in it.src by typing cd ../src.