方式一:
新建一个Building System(Tools–>Building System–>New Building System),在弹出的文本框里面输入以下内容:
{
"cmd": ["javac", "$file_name", "&&", "java", "$file_base_name"],
"working_dir": "${project_path:${folder}}",
"selector": "source.java",
"shell": true,
"encoding":"gbk"
}
"encoding":"gbk" 编码可以根据情况更换utf-8.
方式二:
Sublime Text 3\Data\Packages\User\JavaC.sublime-build
{
"cmd": ["javac", "-J-Dfile.encoding=utf-8","-encoding", "utf-8", "$file"],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "source.java"
}
回答
使用 Sublime Text 3 开发Java程序可以使用
方式三:
The console is accessed via the ctrl+` shortcut or the View > Show Console menu.
import urllib.request,os,hashlib; h = ‘7183a2d3e96f11eeadd761d777e62404‘ + ‘e330c659d4bb41d3bdf022e94cab3cd0‘; pf = ‘Package Control.sublime-package‘; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( ‘http://sublime.wbond.net/‘ + pf.replace(‘ ‘, ‘%20‘)).read(); dh = hashlib.sha256(by).hexdigest(); print(‘Error validating download (got %s instead of %s), please try manual install‘ % (dh, h)) if dh != h else open(os.path.join( ipp, pf), ‘wb‘ ).write(by)
使用 Sublime Text 3 开发Java程序可以使用 Javatar 插件。
https://github.com/spywhere/Javatar