Run code from terminal [Linux]

Thank you,
it works fine on Linux:

x@x:~$ echo 'public class App {
    public static void main(String[] args) {
      System.out.println("Hello, World!");
    }
}
' > App.java | javac -d . App.java | java -classpath . App
Hello, World!
x@x:~$

So, how should I use it to run, for example, this simple code below directly in the linux terminal?

size (600, 600);
strokeWeight(10);
point(300, 200);
strokeWeight(1);

Thank you,
f

2 Likes