当前位置:网站首页>Windows uses commands to run kotlin
Windows uses commands to run kotlin
2022-07-05 09:49:00 【hnjcxy】
Official statement :Kotlin command-line compiler | Kotlin
1、 download kotlin-compiler-1.6.10.zip tool kit , And extract it to an English directory without spaces , Address :Release Kotlin 1.6.10 · JetBrains/kotlin · GitHubhttps://github.com/JetBrains/kotlin/releases/tag/v1.6.10
2、 add to Kotlin environment variable , similar Java How to set environment variables , Find path, Add a message that points to the extracted in the previous step kotlin In the toolkit bin Catalog .
3、 open cmd Command window , View version input :
E:\lins\kotlin\kotlin4>kotlin -version
Kotlin version 1.6.10-release-923 (JRE 1.8.0_291-b10)
4、 newly build hello.kt The source code file , Content :
fun main() {
println("Hello, World!")
}
5、 Compile command ( take hello.kt Translate it into hello.jar)
(1)jar Package contains kotlin The way of runtime ( compile application when ):kotlinc hello.kt -include-runtime -d hello.jar
(2)jar The package does not contain kotlin The way of runtime ( For example, compile library For others applications Invocation time ):kotlinc hello.kt -d hello.jar
6、 Run the command
(1) Run compilation mode (1) Of jar:java -jar hello.jar
(2) Run compilation mode (2) Of jar:kotlin -classpath hello.jar HelloKt
among HelloKt yes hello.jar in , primary kotlin The code is compiled into HelloKt.class The file ,HelloKt
is the main class name.
7、 Other commands
kotlin -help
kotlinc -help
8、 compile class file
(1) compile :kotlinc hello.kt
function :kotlin HelloKt
边栏推荐
- 写入速度提升数十倍,TDengine 在拓斯达智能工厂解决方案上的应用
- How to implement complex SQL such as distributed database sub query and join?
- LeetCode 503. Next bigger Element II
- 90%的人都不懂的泛型,泛型的缺陷和应用场景
- Apache DolphinScheduler 系统架构设计
- Unity skframework framework (24), avatar controller third person control
- idea用debug调试出现com.intellij.rt.debugger.agent.CaptureAgent,导致无法进行调试
- [listening for an attribute in the array]
- Unity skframework framework (XXII), runtime console runtime debugging tool
- SQL learning group by multi table grouping scenario
猜你喜欢
揭秘百度智能测试在测试自动执行领域实践
22-07-04 Xi'an Shanghao housing project experience summary (01)
Uncover the practice of Baidu intelligent testing in the field of automatic test execution
Data visualization platform based on template configuration
Unity skframework framework (XXIII), minimap small map tool
Mobile heterogeneous computing technology GPU OpenCL programming (Advanced)
基于模板配置的数据可视化平台
写入速度提升数十倍,TDengine 在拓斯达智能工厂解决方案上的应用
LeetCode 503. Next bigger Element II
Why don't you recommend using products like mongodb to replace time series databases?
随机推荐
Tdengine already supports the industrial Intel edge insight package
[ManageEngine] how to make good use of the report function of OpManager
Why do offline stores need cashier software?
写入速度提升数十倍,TDengine 在拓斯达智能工厂解决方案上的应用
Gradientdrawable get a single color
[app packaging error] to proceed, either fix the issues identified by lint, or modify your build script as follow
Analysis on the wallet system architecture of Baidu trading platform
Design and exploration of Baidu comment Center
How to implement complex SQL such as distributed database sub query and join?
[JS sort according to the attributes in the object array]
Develop and implement movie recommendation applet based on wechat cloud
Solve the problem of no all pattern found during Navicat activation and registration
Cross process communication Aidl
OpenGL - Coordinate Systems
单片机原理与接口技术(ESP8266/ESP32)机器人类草稿
The popularity of B2B2C continues to rise. What are the benefits of enterprises doing multi-user mall system?
Thermometer based on STM32 single chip microcomputer (with face detection)
[sorting of object array]
Solve liquibase – waiting for changelog lock Cause database deadlock
Principle and performance analysis of lepton lossless compression