You can emit a beep using the beep method in the Toolkit. In order to do it, you should first obtain the default toolkit:

 import java.awt.*;

public class beep {
  public static void main(String args[]) {
     Toolkit.getDefaultToolkit().beep();     
     }
  }