CIS 35A: Introduction to Java Programming

Home | Green Sheet | Lectures | Assignments | FAQ

JDK and IDE

JDK and IDE
DOS commands

Syntax to compile an application

javac ProgramName.java

Syntax to run an application

java ProgramName

Syntax to compile source code with a switch

javac ProgramName.java -switch1Name [-switch2Name]...

Two javac switches

Name Description
deprecation Use this switch to get additional information about any deprecated features that your source code uses.
source Use this switch followed by the version number (1.3 or 1.4) to compile code that works with older versions of the Java interpreter.

A review of DOS commands and keystrokes

Command Description
dir Displays a directory listing.
dir /p Displays a directory listing that pauses if the listing is too long to fit on one screen.
cd \ Changes the current directory to the root directory for the current drive.
cd .. Changes the current directory to the parent directory.
cd directory name Changes the current directory to the subdirectory with the specified name.
letter: Changes the current drive to the drive specified by the letter. For example, entering d: changes the current drive to the d drive.

How to start the DOSKey program

  • Enter "doskey /insert" at the command prompt.
  • To automatically start the DOSKey program for all future sessions, add the "doskey/insert" statement after the "path" statement in the autoexec.bat file.

How to use the DOSKey program

Key Description
Up or down arrow Cycles through previous DOS commands in the current session.
Left or right arrow Moves cursor to allow normal editing of the text on the command prompt.

JDK and IDE | JDK | Directory | Path | API Documentation | DOS commands | TextPad | Eclipse | NetBeans