I mean by in general compiling a code, without using any development environment. Only by using the Terminal as it is called in Mac OS. In windows they call it Command Prompt (the commands differ a bit compared to Terminal).

terminal java compile code

 

STEPS:

  1.  To change the directory in Terminal use cd:java compile terminal
  2. Then, add the directory were your class file is saved.java compile terminal
    1. ? How to know where your file is saved ?
  3. Use the command ls to show the files in the mapjava compile terminal
  4. Next, compile the file:java compile terminalUse javac as command to compile a file
  5. After the command, enter the file name in this case is the:
    1. name: C
    2. type of the file: .java
      java compile terminal
  6. run the file to check if it is successfully compiled: 
    1. because this is the code for file C.java
      C.java
      public class C {
      
      	C () {
      		
      	}
      	
      	void start () {
      		System.out.println("hoi");
      	}
      	
      	public static void main(String[] args) {
      		new C().start();
      	}
      }

      the code is successfully compiled

 

Problem with compiling: