SlickEdit® Core provides a full-featured Java development environment, allowing you to edit, build, and debug Java programs. Topics in this section:
Initial Setup - Read this to configure SlickEdit Core for your JDK and other settings needed for compiling and debugging.
Java-Specific Features - Information about features designed specifically for Java programmers.
Java-Specific Interfaces - Detailed descriptions of dialogs, views, and option screens specific to Java programming.
SlickEdit® Core needs to tag the Java libraries to provide symbol completions and other Context Tagging features for those classes (see Context Tagging Features). When you first run SlickEdit Core after an installation, you are prompted with a dialog to create these tag files. Complete the steps below if you did not create tag files at that time or to configure additional JDKs.
Open the Context Tagging - Tag Files Dialog by selecting Tools → Tag Files.

Click the Auto Tag button to open the Create Tag Files for Compiler Libraries dialog. This dialog is displayed automatically when you first run SlickEdit Core.

SlickEdit Core may detect that you have installed the JDK. If so, the section for Java will be filled out. If not, you will have to configure this manually.
Click the Configure button to open the Java Compiler Properties Dialog. You can have multiple JDKs installed on your computer at the same time and configure SlickEdit Core to use different JDKs for each project. This dialog provides the name and location for each JDK so that you can select it for tagging or building.

Click the Add button to browse to the root of the desired JDK (or JRE). If SlickEdit Core recognizes the Java vendor and version, it will automatically set the appropriate properties. If not, you will be prompted for the configuration name. Give it a name that represents the associated JDK, like "JDK 1.6".
If a default JDK has not been specified, click the Set Default button to set this JDK as the default.
When finished, click the OK button to return to the auto tag dialog.
Make sure there is a check in the Create tag file for Java compiler libraries check box. Depending on your environment, there may be checks in the check boxes for C++ and .NET. Leave those checked if you have not already tagged those libraries. If you just want to tag the Java libraries, uncheck the other check boxes.
Click the Create tag file(s) button.
SlickEdit Core will display a progress bar while your libraries are being tagged. When finished, SlickEdit Core will display the Context Tagging - Tag Files dialog. You can close this if you have no other libraries to tag.
SlickEdit® Core provides many features that work across several languages including Java, and Java-specific information is described throughout the documentation where applicable. The following are additional features designed specifically for Java developers:
Several features are available to help you enter and format Javadoc comments (as well as other doc comment formats). See Doc Comments for more information.
Organize Imports automates the management of import statements in Java files. This feature minimizes the amount of time that it takes to compile code by only importing the classes that are used. Existing import statements are also sorted in a readable format and are more consistent between different Java packages in the same project. Organizing of imports is applied to an entire file.
To organize imports, from the main menu, click Format → Imports → Organize Imports, or from the right-click context menu, select Imports → Organize Imports. Alternately, use the jrefactor_organize_imports command.
To add an import statement for the class name under the cursor in Java code, move the cursor to the class name you want to import, then from the main menu, click Format → Imports → Add Import, or from the right-click context menu, select Imports → Add Import. Alternately, use the jrefactor_add_import command.
Several options are available on the Options dialog to control the behavior of Organize Imports. See Organize Java Imports Options Interface for details.
This section provides detailed information about the following dialogs, views, and option screens that are specific to Java programming:
Options are available for Java for changing the Syntax Indent and Syntax Expansion style settings. To access these options, from the main menu, click Window → SlickEdit Preferences → Languages, expand Application Languages > Java, then click Java Formatting Options.
Languages similar to Java have similar Formatting Options screens that are not specifically documented.

The following settings are available:
Begin/end style - Specify the brace style to be used for Syntax Indent and Syntax Expansion. The hyperlink indicates if Adaptive Formatting is on or off for this setting. After specifying the brace style, choose from the following options:
Insert braces immediately - Specifies whether template should be inserted with braces.
Insert blank line between braces - Specifies whether a blank line should be inserted between braces when a template expands with braces.
Quick brace/unbrace one line statements - Enables Quick Brace/Unbrace, features that allow you to convert a single line statement to a brace-enclosed block, and vice versa. See Quick Brace/Unbrace for more information.
Place "else" on same line as "}" - When this option is selected, SlickEdit® Core places the else keyword on the same line as }. This is common when using brace Style 1.
Indent first level of code - Specifies whether Syntax Indent should indent the cursor after declarations such as functions.
Use continuation indent on function parameters - Determines whether function parameters should always use the continuation indent.
By default, SlickEdit Core formats multi-line function parameters as follows:
myLongMethodName(firstarg,
secondarg,
thirdarg
);
myLongMethodName(
firstarg,
new ActionListener() {
public void actionPerformed(ActionEvent e) {
createdButtonFired(buttonIndex);
}
},
thirdarg
);
myLongMethodName(new ActionListener() { // special case anonymous class first argument
public void actionPerformed(ActionEvent e) {
createdButtonFired(buttonIndex);
}
},
secondarg,
thirdarg
);
myLongMethodName(
secondarg,
new ActionListener() {
public void actionPerformed(ActionEvent e) {
createdButtonFired(buttonIndex);
}
},
thirdarg
);If Use continuation indent on function parameters is selected, the format will change as follows:
myLongMethodName(firstarg,
secondarg,
thirdarg
);
myLongMethodName(
firstarg,
new ActionListener() {
public void actionPerformed(ActionEvent e) {
createdButtonFired(buttonIndex);
}
},
thirdarg
);
myLongMethodName(new ActionListener() { // special case anonymous class first argument
public void actionPerformed(ActionEvent e) {
createdButtonFired(buttonIndex);
}
},
secondarg,
thirdarg
);Indent CASE from SWITCH - When checked, Syntax Expansion places the case statement indented from the switch statement column. The hyperlink indicates if Adaptive Formatting is on or off for this setting.
No space before parenthesis - Determines whether a space is placed between a keyword such as if, for, or while and the open paren when syntax expansion occurs. Example: (if( or if () The hyperlink indicates if Adaptive Formatting is on or off for this setting.
Insert padding between parentheses - When checked, a space is placed after the open paren, and before the close paren, providing padding for the enclosed text. For example, if () becomes if ( ). The hyperlink indicates if Adaptive Formatting is on or off for this setting.
To beautify Java source code, from the main menu click Format → Beautify(or use the gui_beautify command). The Java Beautifier dialog appears, where you can specify preferences for how the code is beautified. The Java Beautifier contains the same options and settings as the C/C++ Beautifier. See C/C++ Beautifier for more information.
Options are available on the Options dialog to configure the Organize Imports feature (Window → SlickEdit Preferences → Languages → Application Languages → Java → Organize Imports). A more direct route to the options is to use one of the following methods:
From the main menu, click Format → Imports → Options
Select Format → Imports → Options from the right-click context menu in the editor window.
Use the jrefactor_organize_imports_options command.

The following settings are available:
Package explicit import limit before using wildcard(.*) - If more than this number of classes are explicitly imported from the same package in one file, the imports will be replaced with a single wildcard import.
Add blank line between groups of imports - Organize Imports will group imports by package name or top-level package name. Select this option to force Organize Imports to add a blank line between these groups instead of having just one flat list of imports.
Number of package nesting levels to group imports by - If this is set to 1, import statements will be grouped by top-level package name only. For example, all your imports from java. packages would be in a separate group from your imports from com. packages. If set to 2, import statements will be grouped by second level package names. For example, all your imports from java.util would be in a separate group from your imports from java.awt.
Automatically add import during code help for Java - If selected, SlickEdit® Core will attempt to automatically add imports as you edit Java code.
Automatically add import during code help for JSP - If selected, SlickEdit Core will attempt to automatically add imports as you edit Java code embedded in HTML. JSP imports are added using the following notation: <%@ page import="java.util.Vector"%>.
Package sort order - This list specifies the order in which package groups are sorted. Use the Ellipses (...) button to add a new package. Use the Up and Down arrow buttons to move items. Use the X button to delete the currently selected package from the list.
Use the Javadoc Editor to generate Javadoc syntax comments for Java, C, C++, JavaScript, and Slick-C®. To access the Javadoc Editor, right-click within the edit window and select Edit Javadoc Comments. Or, with the cursor inside a comment, click Format → Edit Javadoc Comment.
To add a custom or unsupported tag, append the tag (with an @ prefix) and its description into the Description text box. You can add @serial, @serialField, and @serialData fields this way.
For more information, see Sun's Javadoc documentation at http://java.sun.com.
NOTE SlickEdit® Core provides powerful capabilities to create and edit Javadoc comments within the editor. See Commenting for more information.
To beautify Javadoc comments or set up Javadoc Beautifier options, first invoke the Javadoc Editor by right-clicking within the edit window and selecting Edit Javadoc Comments. Then click the Options button. The Javadoc Beautifier Options dialog is displayed. The following settings are available:
Align parameter comments to longest parameter name - If checked, the parameters are aligned to the length of the longest parameter name. If the parameter name length is less than the minimum length, the minimum length is used. If the parameter length is longer than the maximum parameter length, the description for the parameter will start on the next line.
Align exception comments to longest exception name - If checked, the exceptions are aligned to the length of the longest exception name. If the exception name length is less than the minimum length, the minimum length is used. If the exception length is longer than the maximum exception length, the description of the parameter will start on the next line.
Align return comments - Indicates whether @return comments should be aligned to the first line of comment text. No alignment is performed if tags which are indent-sensitive such as the <pre> tag are used.
Align deprecated comments - Indicates whether @return comments should be aligned to the first line of comment text. No alignment is performed if tags which are indent-sensitive such as the <pre> tag are used.
Add blank line after parameter comment - If checked, a blank line is added if a tag follows an @param tag.
Add blank line after parameter comment group - If checked, a blank line is added if a tag follows an @param group.
Add blank line after return comment - If checked, a blank line is added if a tag follows the @return tag.
Add blank line after description - If checked, a blank line is added between the description and the first @ tag. This option is ignored if the description contains a custom or unsupported @ tag.
Add blank line after example - If checked, a blank line is added if a tag follows the @example tag.