How to compile JAVA on Sublime text 2 using Mac OS X?

末鹿安然 提交于 2019-12-24 17:48:01

问题


I've looked all over the internet only finding very complicated results and now im not sure what to do.


回答1:


Sublime text 2 has builtin Java support:

Which means that once you have opened the Java source, all you have to do is press command+B


What you described in the comments is a bit different - you should update your post with this information!

Devin posted a gist solution here:

You should add a new build-system by going to the menu:

Tools --> Build System --> New Build System

and add the following json and save it as "Java.sublime-build" into the default directory (which is something like: ~/Library/Application Support/Sublime Text 2/Packages/User/):

{
    "cmd": ["javac", "$file_name"],
    "cmd": ["java", "$file_base_name"],
    "working_dir": "${project_path:${folder}}",
    "selector": "source.java"
}

Next time you want to compile & run use "Java.sublime-build" from your build-systems.



来源:https://stackoverflow.com/questions/30564613/how-to-compile-java-on-sublime-text-2-using-mac-os-x

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!