I am trying to compile and run Java code in Sublime Text 2. Don\'t just tell me to do it manually in the Command Prompt. Can anyone tell me how?
Btw, I am on Windows
I am using Windows 7. The below solution works for me!!
**Open** the file JavaC.sublime-build and replace all the code in the file with the code below:
{
"cmd": ["javac", "$file_name","&&","java", "$file_base_name"],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
**"path": "C:\\Program Files\\Java\\jdk1.6.0\\bin\\",**
"selector": "source.java",
"shell": true
}
Remember to replace "C:\Program Files\Java\jdk1.6.0\bin\" with the path where you put your jdk. And make sure to add the path of you java JDK to the environment variable "PATH". Refer to bunnyDrug's post to set up the environment variable. Best!!