mac环境下sublime text3怎么运行java

1. 配置 Java Build System

配置 Java Build System:为了让 Sublime Text 知道如何编译和运行 Java 代码,你需要配置 Java Build System。在 Sublime Text 中,点击菜单栏的 Tools > Build System > New Build System。

{

"shell_cmd": "javac -encoding utf-8 $file_name && java $file_base_name",

"working_dir": "${project_path:${folder}}",

"file_regex": "^ *\\[javac\\] (.+):([0-9]+):() (.*)$",

"selector": "source.java",

"encoding": "utf-8",
"shell": true

}

保存并命名为 “Java.sublime-build”(或者你可以自定义一个名称)

2. 运行 Java 程序

Ctrl+B(或者 Cmd+B)来编译并运行 Java 程序。如果有编译错误,它们会在 Sublime Text 的底部面板中显示。

3. 遇到的问题和解决

mac系统下sublime text3出现[Finished in 982ms]不出结果

  1. 检查 Java 安装和环境变量:
java -version
  1. 用户级别配置:这个配置适用于所有用户

在 macOS 上,用户级别的配置文件位于 ~/Library/Application Support/Sublime Text 3/Packages/User 目录下.使用终端或文件浏览器访问这个目录。Java Build System 的配置文件应该在这里。

在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
3.0 (BUILD 3143) 13 September 2017 See also the Announcement Post Refreshed UI theme, including full high DPI support New icon Added alternate theme, Adaptive, that inherits colors from the color scheme Added new color schemes Breakers, Mariana and Sixteen, derived from the excellent work of Chris Kempson and Dmitri Voronianski Added color scheme and theme switchers with live preview via the command palette Windows: Added touch input Linux: Added repositories for apt, yum and pacman Mac: Added Touch Bar support Mac: Support for custom color window title bars on OS X 10.10+ Many additions and bug fixes to the theme engine, plus full documentation Significant improvements to Markdown syntax highlighting, with thanks to keith-hall Significant improvements to C# syntax highlighting, with thanks to gwenzek Significant improvements to Java syntax highlighting, with thanks to djspiewak Significant improvements to Python syntax highlighting, with thanks to FichteFoll Significant improvements for R syntax highlighting, with thanks to randy3k Markdown: Improved symbol handling C#: Improved symbol handling Many other syntax highlighting improvements Various bugs with the syntax highlighting engine have been resolved Fixed several crash issues Improved responsiveness when the system is under high CPU load High DPI textures are used on Windows and Linux when the DPI scale is greater than 1.0 Improved font selection on all platforms, allowing selection of different weights by name Added setting theme_font_options to control font rendering of UI elements Improved auto indent rules for HTML and PHP Font geometry issues that prevent bold or italics are now printed in the console Fixed flash-of-white that could occur when the auto complete window is closed Disable scroll animation when animation_enabled is false in settings Files can now be renamed when only the case has changed New windows start with an empty find history Find in Files panel now responds to find_all and replace_all commands Various regex handling improvements in the Find panel Fixed text widgets cutting off the bottom pixel of their selection border Fixed an issue with close_windows_when_empty in empty session Fixed empty panes on startup when hot_exit was set to false Fix Open Containing Folder on Windows with a folder containing a comma Fix multi-cursor pasting when clipboard contains one or more full lines Prevent UNC paths from being mangled by edit_settings Prevent a crash when a malformed regex is used in indentation settings Improved rendering performance with a large number of gutter icons Gutter icons are now sized properly on Windows and Linux high DPI screens Improved sidebar performance when folders contain many thousands of files Improved inline error message style Fixed an issue where multiple indexing status windows could be shown Windows: Font rendering defaults to DirectWrite unless using Consolas or Courier New Windows: Added support for no_antialias font option when using DirectWrite Windows: Improved touch pad scrolling Windows: Improved file change detection robustness Windows: Improved font selection logic Windows: Fix ctrl+` shortcut for UK (ISO) keyboards Windows: Improved fallback font handling in UI elements Windows: The subl executable on OS X and plugin_host.exe on Windows are now signed Windows: sublime_text.exe now has CompanyName set in VERSIONINFO Mac: Handle layout changes due to macOS Sierra tabs Mac: Improved default web browser detection Mac: OS X 10.11 and macOS 10.12+ default to using San Francisco for the UI font Mac: Fixed file change notifications from freezing UI on macOS Sierra Mac: the user's default shell is executed and environmental variables are set in the plugin Python environment Linux: Update X11 selection on clipboard every time selection changes Linux: Improved MOD3 modifier key handling minihtml: Added support for borders minihtml: Respects font_options from the settings minihtml: Fixed layout of html popups on Windows and Linux under High DPI minihtml: Fixed crash when doctype is present minihtml: Fixed a crash from non-existent CSS vars minihtml: Fixed a crash triggered by bad image paths API: Add View.text_to_window() and View.layout_to_window() API: All API functions now accept and return device-independent-pixels API: Fixed input panel not running on_cancel when re-showing the input panel API: Fixed selector scoring with the & operator API: Fixed a bug causing incorrect phantom contents API: Fixed crash in Window.set_view_index() API: Updated OpenSSL to 1.0.2k, SQLite to 3.16.02 BUILD 3126 23 September 2016 Added Indexing Status to the Help menu to give more information about what the indexer is doing Fixed a compatibility issue with some third party syntax definitions that include JavaScript.sublime-syntax Reduced the default number of worker processes used for indexing. This can be manually controlled via the index_workers setting API: Updated OpenSSL to 1.0.2i

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值