Run Java programs using sublime text3
The tutorial column of sublime below will introduce to you how to use sublime text3 to run Java programs. I hope it will be helpful to friends in need!
Since I don’t want to learn Java in the IDE, I want to use sublime for Java development, so there is the question of how to compile and run Java in sublime. .
I found many tutorials on the Internet, but I still couldn't output the results. Later I found out that it was due to a deviation in my understanding. (Write it down. When you read the article in the future, you must fully understand its content and meaning before you can act).
(1) First, find the sublime package folder and find the java.sublime-pakage compressed package in it:
(2) Use Open it with decompression software (emphasis on: not decompressing it directly) (I use 360 decompression):
(3) Write a JavaC.sublime-build file ( The suffix is sublime-build, the content is as follows):
{ "cmd": ["javac","-d",".","$file"], "file_regex": "^(...*?):([0-9]*):?([0-9]*)", "selector": "source.java", "encoding":"cp936", //执行完上面的命令就结束 // 下面的命令需要按Ctrl+Shift+b来运行 "variants": [ { "name": "Run", "shell": true, "cmd" : ["start","cmd","/c", "java ${file_base_name} &echo. & pause"], //c是执行完命令后关闭cmd窗口, // /k是执行完命令后不关闭cmd窗口。 // echo. 相当于输入一个回车 // pause命令使cmd窗口按任意键后才关闭 "working_dir": "${file_path}", "encoding":"cp936" } ] }
(4) Add the written file to the java.sublime-pakage compressed package (just copy and paste it directly)
(5 ) Then reopen sublime, write the Java source file, and then press ctrl shift b. You can choose to compile or run. The results are as follows:
The above is the detailed content of Run Java programs using sublime text3. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Methods to improve programming efficiency using SublimeText include: 1) Proficient in using shortcut keys, such as Ctrl Shift D to copy lines; 2) Use multi-line editing functions, such as Ctrl mouse click to select multiple positions; 3) Install plug-ins, such as Emmet to generate HTML/CSS code; 4) Custom configuration files, such as setting font size and color theme. Mastering these techniques can greatly improve your coding speed and work efficiency.

SublimeText's multi-cursor editing function improves editing efficiency through the following methods: 1. Use Ctrl D to select the next matching word, which is suitable for operations such as replacing variable names. 2. Use Ctrl Click to add a new cursor, suitable for editing in non-continuous positions. 3. Use Ctrl U to cancel the last selection to help adjust the selection range. 4. Split the selected text into multiple lines of cursor through Ctrl Shift L to optimize the editing of large files.

The methods to customize SublimeText include: 1. Create and modify theme files, such as MyTheme.sublime-theme, and adjust the editor's appearance; 2. Customize key bindings, set shortcut keys through the Default (Windows).sublime-keymap file; 3. Install PackageControl and manage plug-ins through it, such as Emmet and SublimeLinter, and expand editor functions.

SublimeTextSnippets is a predefined code template that quickly inserts code through shortcut keys or trigger words to improve programming efficiency. 1. Create Snippets: Based on XML format, stored in .sublime-snippet file. 2. Use example: Enter a trigger word such as "def" or "html5" and press the Tab key to automatically generate the code structure. 3. Avoid errors: Make sure the trigger words are unique, set the correct scope, and keep the XML format correct.

SublimeText's BuildSystems can automatically compile and run code through configuration files. 1) Create a JSON configuration file and define the compilation and running commands. 2) Use shortcut keys to trigger BuildSystems to execute the command. 3) Optimize configuration to improve performance, such as using cache and parallel compilation. This allows developers to focus on writing code and improve development efficiency.

Using the CommandPalette of SublimeText can improve productivity. 1) Open CommandPalette (Ctrl Shift P/Windows/Linux, Cmd Shift P/Mac). 2) Enter the command keyword, such as "InstallPackage" or "DarkTheme". 3) Select and execute commands, such as installing plug-ins or switching themes. Through these steps, CommandPalette can help you perform various tasks quickly and improve the editing experience.

Search and replace using regular expressions in SublimeText can be achieved through the following steps: 1. Turn on the search and replace function, using the shortcut keys Ctrl H (Windows/Linux) or Cmd Opt F (Mac). 2. Check the "regular expression" option and enter the regular expression mode to search and replace. 3. Use the capture group to extract matching content, for example, use https?://(1) to extract the domain name in the URL. 4. Test and debug regular expressions to ensure that the required content is correctly matched. 5. Optimize regular expressions to avoid over-match and use non-greedy matching to improve performance. /↩
