当前位置:网站首页>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 · GitHub
https://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
边栏推荐
- Idea debugs com intellij. rt.debugger. agent. Captureagent, which makes debugging impossible
- MySQL does not take effect in sorting string types
- Develop and implement movie recommendation applet based on wechat cloud
- The research trend of map based comparative learning (gnn+cl) in the top paper
- What should we pay attention to when entering the community e-commerce business?
- On July 2, I invite you to TD Hero online press conference
- SMT32H7系列DMA和DMAMUX的一点理解
- 一文读懂TDengine的窗口查询功能
- 解决Navicat激活、注册时候出现No All Pattern Found的问题
- Community group buying has triggered heated discussion. How does this model work?
猜你喜欢

Why don't you recommend using products like mongodb to replace time series databases?

单片机原理与接口技术(ESP8266/ESP32)机器人类草稿

Mobile heterogeneous computing technology GPU OpenCL programming (Advanced)

植物大战僵尸Scratch

Go 语言使用 MySQL 的常见故障分析和应对方法

【技术直播】如何用 VSCode 从 0 到 1 改写 TDengine 代码

7 月 2 日邀你来TD Hero 线上发布会

Cross process communication Aidl

Unity SKFramework框架(二十四)、Avatar Controller 第三人称控制

Solve liquibase – waiting for changelog lock Cause database deadlock
随机推荐
[Yugong series] go teaching course 003-ide installation and basic use in July 2022
7 月 2 日邀你来TD Hero 线上发布会
Application of data modeling based on wide table
【饿了么动态表格】
[JS sort according to the attributes in the object array]
Solve the problem of no all pattern found during Navicat activation and registration
Baidu app's continuous integration practice based on pipeline as code
Android SQLite database encryption
[sorting of object array]
OpenGL - Coordinate Systems
Observation cloud and tdengine have reached in-depth cooperation to optimize the cloud experience of enterprises
从“化学家”到开发者,从甲骨文到TDengine,我人生的两次重要抉择
LeetCode 503. 下一个更大元素 II
oracle 多行数据合并成一行数据
How to improve the operation efficiency of intra city distribution
Tdengine offline upgrade process
[hungry dynamic table]
A detailed explanation of the general process and the latest research trends of map comparative learning (gnn+cl)
【对象数组的排序】
uni-app---uni. Navigateto jump parameter use