Playground

A place of your own for any Java you want to try: no steps, no checks, nothing to follow. Change Main.java, add files, break things. Your files live in the folder ~/playground and stay in this browser.

  • Run (Ctrl+Enter, ⌘↵ on a Mac) compiles every .java file in the folder and runs Main.
  • The files panel adds, renames and deletes files and folders; a folder is a package. Ctrl+B (⌘B on a Mac) in the editor shows or hides it, Ctrl+P (⌘P) opens a file by name.
  • The Terminal tab is a Linux shell: cd ~/playground, then javac, java or anything else.
  • Reset code in the ⋯ menu puts the starter Main.java back and deletes every other file in the folder.

Back to the course

public class Main {
    public static void main(String[] args) {
        System.out.println("Hello, world!");
    }
}
Terminal
Playground

Keyboard shortcuts

The workspace

Run the stepCtrl+Enter (⌘↵ on a Mac)
Lesson → editor → consoleF6 (Shift+F6 back)
Output ↔ TerminalCtrl+`
Focus the editorCtrl+. (⌘. on a Mac)
Hide or show the lessonAlt+L
Restore, close a messageEsc (outside the editor and the terminal)

The editor

Leave the editorF6 (Shift+F6 back); or Ctrl+M (⌃⇧M on a Mac), then Tab moves the focus (not in the vim mode)
Open a file by nameCtrl+P (⌘P on a Mac)
All commandsCtrl+Shift+P (⌘⇧P on a Mac) or F1
Go to a lineCtrl+G (⌃G on a Mac)
Show or hide the filesCtrl+B (⌘B on a Mac)
Previous / next file tabCtrl+Shift+[ · Ctrl+Shift+] (⌘⇧[ · ⌘⇧] on a Mac)
The file tabs← → Home End on a tab; Delete closes it
Save the files nowCtrl+S (⌘S on a Mac)
Go to a symbol in the fileCtrl+Shift+O (⌘⇧O on a Mac)
Go to the definitionF12
Format the fileCtrl+Shift+F (⌘⇧F on a Mac), or Shift+Alt+F
Go back / forward after a jumpAlt+← · Alt+→ (⌃- · ⌃⇧- on a Mac)