Write and run the Java program on sublime Text 3

Source: Internet
Author: User
Tags sublime text

Reference

The first thing is to install the JDK configuration environment variable, this is not much to say.

The second step is to download and install sublime Text3.

The third step is to create a batch file named Runjava.bat, which is placed under the bin of the JDK:

1@ECHO OFF2cd%~DP13ECHO Compiling%~nx1 .....4 IFEXIST%~n1.class (5DEL%~n1.class6 )  7Javac%~nx18 IFEXIST%~n1.class (9ECHO-----------OUTPUT-----------TenJava%~n1 One)
Expand

Fourth step, find the sublime installation directory under the Packages Java.sublime-package, open with the compression software, find javac.sublime-build this file. This file may not be modified directly, can be copied out in the outside to be modified and then overwritten back (better to do a backup). File modified to:

1 {2   "Shell_cmd":"runjava.bat \"$file\"",3    "File_regex":"^(...*?):( [0-9]*):? ([0-9]*)",4    "selector":"Source.java",5    "encoding":"UTF-8"6}
View Code

Then write a test code:

1  Public class demo{2      Public Static void Main (string[] args) {3         System.out.println ("Lalala demacia"); 4     }5 }
View Code

Pressing the shortcut key CTRL + B will result in the following results, but if the code has errors it will not error ... :

Write and run the Java program on sublime Text 3

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.