Java Development Plugin for Sublime Text 3

View the Project on GitHub spywhere/Javatar


Status: Beta

A Sublime Text 3 Plugin for Java Development

Table of Contents


[+] Available on Stable Channel
[*] Partial available on Development Channel
[-] Planned

Important Updates

From 15 Jan 2014, Javatar will include full Java SE7 class list inside its package. This will take a little longer to install/update Javatar. For another Java version, please check out Additional Packages section.

Development Build
Stable Build


Creating packages in action


Creating classes in action


Creating other classes in action


Class operations in action


Command Categories

Javatar Builds

Javatar use its own build system which based on default Sublime Text's JavaC build settings.

Important! When build on a project or package, Javatar cannot show any compilation error (or may show only last run built) since it builds all your classes in order. More details about build system is on Build System.

Javatar Calls

Javatar Calls are use to insert class or package informations at cursor point. Javatar supports 4 types of informations to insert which are Full Package Path, Current Package Path, Full Class Name and Class Name.

Advanced Creations

In create menu, all packages and classes will be created relative to current package unless specified by ~ (tilde) before package or class path. See examples below...

Input: Alpha
Result as Class: Class "Alpha" is created in current pacakge
Result as Package: Package "Alpha" is created in current package

Input: ~Beta
Result as Class: Class "Beta" is created in default pacakge
Result as Package: Package "Beta" is created in default package

Input: me.spywhere.Alpha
Result as Class: Class "Alpha" is created in "(current package).me.spywhere" package
Result as Package: Package "Alpha" is created in "(current package).me.spywhere" package

Input: ~me.spywhere.Beta
Result as Class: Class "Beta" is created in "me.spywhere"
Result as Package: Package "Beta" is created in "me.spywhere"

Javatar Operations

Javatar Operations help you do class or package operations, such as organize imports or rename class, easier. Currently, Javatar has 2 operations, Correct Class and Organize Imports.

Correct Class

Javatar will search for current package and your class name based on file name and location of current file and correct it on first class.

Organize Imports

Javatar will automatically imports all necessary packages and remove unused packages for you. This is done within 7 sub-steps.

  1. Javatar gathering imports informations from current file
  2. Javatar let's you select a package that has the same class
  3. Javatar imports "default imports" and Java's packages
  4. Javatar asks you to enter package name for missing classes
  5. Javatar asks for package name that you want to enter manually
  6. Javatar clear all imports in current file
  7. Javatar imports all packages that has been processed within step 1-4

Default Package Detection

Javatar will specify default package with these steps...

  1. Project folder in your project file (when open project or folder)
  2. Folder contains current file (when open file)
  3. Specify current package as (Unknown Package)

Javatar will refuse to create packages or classes within unknown package. In this case, mostly because current file is not on the disk yet.


Package Control (Recommended)

Open command palette and type Install Package then type Javatar and hit Enter/Return. Package Control will automatically download, install and update for you.

"git" Command

Open your favourite Terminal application, browse to PACKAGES_PATH and run this command.

git clone git://
Manual Install

Download .zip file from Javatar repository and browse to PACKAGES_PATH, extract .zip file and rename folder to Javatar, restart Sublime Text if you are currently open.

Note! PACKAGES_PATH is referred to folder which can be accessed via the Preferences > Browse Packages...


Settings can be accessed via the Preferences > Package Settings > Javatar or via command palette by type "Preference Javatar".

Default settings should not be modified. However, you can copy the relevant settings into Javatar's user settings file.

Key Bindings

Key bindings can be accessed via the preference menu or via command palette same as settings.

Default Key Binding

All commands start with Key+Shift+K then follows by their shortcut key.

Build System

Javatar's build system use Sublime Text execute command to build your classes. Javatar build parameters are based on default Sublime Text's JavaC build settings. You can change the build command via Javatar settings file.

Javatar Snippets

Javatar snippets is a dynamic snippet which will change part of the file to correspond with package path and class name. By using macros, you can specify which part of the file you want to fill the data to.

You can make your own snippet to use within Javatar by create a new file ends with .javatar

Snippet class tags (for more informations about snippet tags, see below) will be used as a type of classes which show in input panel when create a new file (%type% Name:), on error dialog (%type% %name% already exists) and in status bar when file was created (%type% %name% is created within package %package%).

Example of Javatar's snippets is inside Javatar's snippets folder (PACKAGES_PATH/Javatar/snippets or similar)

Snippet Tags

The following tags are used inside Javatar snippet files (*.javatar) which will be used by Javatar to display proper command to the user

Usage of snippet tags in action


Snippet Macros

The following macros are used inside Javatar snippet files (*.javatar) which will be parsed by Javatar and Sublime Text.

Javatar Packages

Javatar required packages file (*.javatar-packages) to correctly import necessary Java's packages. These files contain all classes, fields, methods and packages to use with Javatar.

Javatar Packages file is a JSON file. You can read more details about each key and value in Proto.javatar-packages located within Javatar's Java folder.

However, their are 2 special keys that is not normally used within Javatar Packages which are...

Both keys are boolean type and also optional to use.

Example of Javatar Packages is located inside Javatar's Java folder (PACKAGES_PATH/Javatar/Java)

Additional Packages

By default, Javatar package will include Java SE7 class list inside its package. This will make Javatar take a little longer to install/update from Package Control. For other Java version, you can check out a link to additional package inside Help and Support > Download Packages menu.

Package Channels

Stable Channel

Stable channel is a default channel for every user who installed Javatar. This channel will release only fully working features and hide all incomplete features.

Development Channel

Development channel is a optional channel for user who want to try upcoming features which may not fully working or need improvements. All upcoming features will appear in Javatar: Browse Commands > Development Section only.

Please note that stable channel update notes also apply on development channel too.

Package Updates Notifications

In order to notice important notes to all users, in stable channel or development channel or both, Javatar use custom notification system which will notice you only once when Javatar is ready to use. You can opt out this notification by settings message_id to -1 in Javatar's user settings file, note that you can see update notes in README file or you will miss further important update notes.

Actions History

Actions History tracks how you use Javatar and helps solve the problem. By provides useful informations as request by developer (only when you submit an issue). A Javatar Action History Report will looks like this when using it properly...

## Javatar Report
### System Informations
* Javatar Version: ``
* Sublime Version: `3047`
* Package Path: `/Users/spywhere/Library/Application Support/Sublime Text 3/Packages`
* Javatar Channel: `dev`
* Sublime Channel: `stable`
* Platform: `osx`
* As Packages: `True`
* Package Control: `True`
* Architecture: `x64`
* Javatar's Parent Folder: `Javatar`
* Is Project: `True`
* Is File: `True`
* Is Java: `True`

### Action List
1. Startup
2. Reset all settings
3. Reset all snippets
4. Read settings
5. Load snippets
6. Javatar Snippet AbstractClass.javatar loaded
7. Analyse snippet [file=/Users/spywhere/Library/Application Support/Sublime Text 3/Packages/Javatar/snippets/AbstractClass.javatar]
8. Javatar Snippet Class.javatar loaded
9. Analyse snippet [file=/Users/spywhere/Library/Application Support/Sublime Text 3/Packages/Javatar/snippets/Class.javatar]
10. Javatar Snippet Enumerator.javatar loaded
11. Analyse snippet [file=/Users/spywhere/Library/Application Support/Sublime Text 3/Packages/Javatar/snippets/Enumerator.javatar]
12. Javatar Snippet Interface.javatar loaded
13. Analyse snippet [file=/Users/spywhere/Library/Application Support/Sublime Text 3/Packages/Javatar/snippets/Interface.javatar]
14. Check news
15. Ready

Javatar do not automatically send these informations. You have to reply an issue with these informations yourself.

Actions History can be disabled by settings enable_actions_history to false