Sublime Text Java Plugins

使用sublime text搭建java开发环境

1.sublime text自带的java语法高亮和函数跳转足够我们审阅java代码,但是作为开发级别却远远不够。我们厌倦了eclipse漫长的等待和庞大的内存消耗,所以转向了轻量级的文本编辑器,而sublime text强大的插件系统为我们提供了自定义IDE的可能。系统配置好JDK之后,sublime自带的build system也预先准备了java的编译脚本,这对hello world级别的java代码来说是足够的,但是对于稍微复杂点的java工程,就显得捉襟见肘了.

2.那么如何使用sublime?
这里推荐几个插件,都可以使用sublime自带的package control快速获得.

JavaIME

可以实现包的快速导入,和各种变量的快速初始化

目前支持:

  • Class Instance
1
Type I-class name e.g. I-Scanner should show “java Scanner input = new Scanner(System.in);
  • Class declaration
1
2
3
4
5
pc -> generates a public class declaration
pcm -> generates the public class declaration with a main method
pcc -> generates the public class declaration with a constructor
pccm -> generates the public class declaration with a main method and constructor
pcfx -> generates a public class declaration for JavaFX and a main mTestethod.
  • Import
1
2
Note you can also press ENTER rather than TAB

  • Auto-Complete listener interfaces
1
To show a listener interface completion, type L- followed by the listener interface name. e.g.
  • Static properties
1
Type S- followed by method name. e.g. Type s-magenta then TAB to generates

Javatar

一个强大的多方面支持java开发的插件系统,目前官方的说法是支持以下:

  • Packages and Subpackages creation
  • Class (also Abstract), Interface and Enumeration snippets with
  • package/class name auto-complete and auto-import
    Project/Package/Class build and run with dependencies [2]
  • Packages path in status bar
  • External libraries packages
  • Internal console with input supports
  • Organize Imports

亲测感觉还不错,但是还没看到第三方jar包管理的那部分,有空再研究一下。官网上跟着startup做一遍基本上就会用了。