Sublime Text Compilation Run Kotlin

Source: Internet
Author: User
Tags sublime text


Kotlin recently is a fire, so want to try, of course, IntelliJ is very useful, but open a bit slow, for me this just touch kotlin small white ... (I was impatient 0.0.)



So think or try to be able to use sublime text directly compiled run, words not much to say, directly on dry:



I have already installed the Java environment by default.



1. The first step is to download kotlin-compiler-1.1.2-2.zip



Unzip it into any directory and add the bin directory to the environment variable.






Reference here: https://kotlinlang.org/docs/tutorials/command-line.html






At the command prompt, enter Kotlinc:






The environment variable setting is complete, ": Quit" exits.






2.Sublime Text under:tools-->build system-->new Build System ...





The following code:






{
	"cmd": ["Kotlinc", "$file _name", "-include-runtime", "-D", "${file_base_name}.jar", "&&", "Java", "-jar" , "${file_base_name}.jar"],
	"File_regex": "^ (... [^:]*]:([0-9]+):? ([0-9]+)?:? (. *) $ ",
	" Working_dir ":" ${file_path} ",
	" selector ":" Source. Konlin ",
	" shell ": true
}





Save as Kotlinc.sublime-build file.  (This file directory is in the sublime text of the Preferences-->browse Packages ... User directory)



All right. Write a HelloWorld try, ctrl+b try:









Discovery generates a Hello.jar command line to run this file directly. Use the compression software to view the file structure:






Still think St write point what test with very convenient.



PS: Small white just contact Kotlin, also ask the gods to strike a light 0.0.






Reference:


working with the Command line Compiler:


Https://kotlinlang.org/docs/tutorials/command-line.html



Sublime Text Build system--compile run Java :



Http://www.cnblogs.com/bananaplan/p/Sublime-Text-Run-Java.html





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.