Way One:
Create a new Building system (tools–>building system–>new Building System) and enter the following in the popup text box:
{
"cmd": ["Javac", "$file _name", "&&", "Java", "$file _base_name"],
"Working_dir": "${project_path:${folder}}",
"Selector": "Source.java",
"Shell": true,
"Encoding": "GBK"
}
"Encoding": "GBK" code can be changed according to the situation Utf-8.
Way two:
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"
}
Reply
Using Sublime Text 3 to develop Java programs can be used
Way three:
the console is accessed via the Ctrl + '
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.pat H.join (IPP, PF), ' WB '). Write (by)
You can use the Javatar plugin to develop Java programs using Sublime Text 3.
Https://github.com/spywhere/Javatar
Sublime Text 3 Compilation run Java