- Navigate into a folder with the
.javafiles
cd SheetX/ExerciseY/
ls
Main.java File1.java File2.java
- Compile the
.javafiles usingjavac. This results in the creation of the.classfiles (Bytecode).
javac Main.java File1.java File2.java
ls
Main.java File1.java File2.java
Main.class File1.class File2.class
- Run the program with
javaand the name of the file containing themain-method
java Main
Arguments can be added after the name of the file. Those are stored in the parameter String[] args of the main-method.
java Main Argument1 Argument2
Instead of compiling the files via the terminal, an IDE like IntelliJ can be used. This is especially recommended for the exercises with dependencies that are managed via Maven.