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