The steps to configure sublime Text2 are as follows:
1: Windows
Create a file using the following code Runjava.bat
@ECHO OFFcd %~dp1ECHO Compiling %~nx1....... IF EXIST %~n1.class (DEL %~n1.class) javac %~nx1IF EXIST %~n1.class (ECHO -----------OUTPUT----------- java %~n1)
2: Copy the batch file Runjava.bat to the JDK's Bin directory
3:
On the tab Preferences > Browse Packages "If it is a Chinese version, here is the" Good > Browse Package "" Open Sublime Package directory
Then find Javac.sublime-build open and replace as follows:
Will:
"cmd": ["runJava.bat", "$file"],
Replace with:
"cmd": ["Runjava.bat", "$file"],
then write a test program that uses CTRL+B to run the test under ....
Note: Generally to the 3rd step can be successful, but sometimes sublimt2 console will still have nothing at this time we can use
"Ctrl + ~" Open the console to see the records of the program tracking can see what caused the unsuccessful ....
The situation I encountered was "' ASCII ' codec can ' t decode byte 0xd0 in position 3"
Here's a workaround:
Locate the exec.py in the Default Package tab Preferences > Browse Packages >DefaultReplace about45 Line Position:
Proc_env[k] = Os.path.expandvars (v). Encode (Sys.getfilesystemencoding ())
to be
Proc_env[k] = Os.path.expandvars (V.decode (sys.getfilesystemencoding ())). Encode (Sys.getfilesys Temencoding ())
Then save the test for a moment.
This article is from the "11930414" blog, please be sure to keep this source http://11940414.blog.51cto.com/11930414/1835139
Sublime Text2 Configuring the Java Environment