# Java editor

The Java editor provides specialized features for editing Java code.

Associated with the editor is a Java-specific Outline view, which shows the structure of the active Java compilation unit. It is updated as the user edits the compilation unit.

The Java editor can be opened on binary CLASS files. If a JAR file containing the CLASS files has a source attachment, then the editor shows the corresponding source.

The editor includes the following features:

- Syntax highlighting
- Content/code assist
- Code formatting
- Import assistance
- Quick fix
- Integrated debugging features

The Java editor can be configured to either show an entire compilation unit or a single Java element only. To change the setting, use the toolbar button Show Source of Selected Element Only.

The most common way to invoke the Java editor is to open a Java file from the Navigator or Package explorer using pop-up menus or by clicking the file (single or double-click depending on the user preferences). You can also open the editor by opening Java elements, such as types, methods, or fields, from other views.

Java development tools (JDT)

Opening an editor for a selected element
Using the Java editor
Using content/code assist
Formatting Java code
Adding required import statements
Generating getters and setters
Viewing compilation errors and warnings
Viewing runtime exceptions
Evaluating expressions

Java editor actions
Java editor preferences
Outline view for Java
Views and editors