Linux has several built-in editors

Each editor has its supporters and its detractors. Learn them all and decide for yourself.

  • Open a terminal window
  • cd to your program project's folder if it exists:
     cd ~/private/cs400/programs/practice/
  • Try ...
    1. pico (easy to use Ctrl-x to quit)
      pico MyProgram.java
    2. emacs (popular, Ctrl-x Ctrl-c to quit)
      emacs MyProgram.java
    3. vi (or vim - my personal favorite)
      vi MyProgram.java
      You will need to learn about modes to use vi - here's a tutorial to help you get started.  Or, google vi tutorial to find many more.
  • Remember

    Java programs must be compiled and linked before they can be run.

        javac *.java
        java MyProgram 10 5 2
    

    The example above will compile all *.java files in the current directory and then run the main method of the MyProgram class, and pass in three command-line arguments "10 5 2". If there is no MyProgram class, or it does not have a main method, an error occurs.