How to compile Java SE7 script in Sublime Text 2?
How to set up a compiler for Java?
How to compile Java SE7 script in Sublime Text 2?
How to set up a compiler for Java?
I still recommend using eclipse / idea / emacs / vim. But if you really want to ...
In principle, nothing needs to be set up - everything is already there. After you open your file, just go to Tools-> Build System and make sure JavaC is selected. If not, choose. Everything, now you can press Ctrl+B
and the saber will launch javac for compilation.
Of course, you need to install zhavu. And set up what she was in the ways. On my laptop under Fedora, everything started right away.
In the menu, select Tools-> Build System -> New Build System, after which a new tab will open where you need to insert the following text:
{ "cmd": ["javac", "$file_name","&&","java", "$file_base_name"], "shell": true, "path": "c:/Program Files/Java/jdk1.8.0_60/bin", "file_regex": "^(...*?):([0-9]*):?([0-9]*)", "selector": "source.java" }
The parameter "path" indicates the path to the JDK, if you have it different, change it to your own. Or you can delete the entire line if your path is registered in the system variable.
Now press the "ctrl + s" combination and save the execution settings file under any name, for example "JavaCompileRun".
The last step is to select the menu item Tools-> Build System -> JavaCompileRun and further, by pressing "ctrl + b" the open file with java-code will be executed.
Source: https://ru.stackoverflow.com/questions/143912/
All Articles