当前位置:网站首页>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
边栏推荐
- 如何正确的评测视频画质
- 卷起來,突破35歲焦慮,動畫演示CPU記錄函數調用過程
- Android privacy sandbox developer preview 3: privacy, security and personalized experience
- [listening for an attribute in the array]
- How Windows bat script automatically executes sqlcipher command
- Node-RED系列(二九):使用slider与chart节点来实现双折线时间序列图
- [two objects merged into one object]
- Tdengine already supports the industrial Intel edge insight package
- 【组队 PK 赛】本周任务已开启 | 答题挑战,夯实商品详情知识
- 百度智能小程序巡检调度方案演进之路
猜你喜欢
使用el-upload封装得组件怎么清空已上传附件
oracle 多行数据合并成一行数据
[ManageEngine] how to make good use of the report function of OpManager
[team PK competition] the task of this week has been opened | question answering challenge to consolidate the knowledge of commodity details
【C语言】动态内存开辟的使用『malloc』
Android privacy sandbox developer preview 3: privacy, security and personalized experience
[listening for an attribute in the array]
Nips2021 | new SOTA for node classification beyond graphcl, gnn+ comparative learning
LeetCode 31. Next spread
[sourcetree configure SSH and use]
随机推荐
The popularity of B2B2C continues to rise. What are the benefits of enterprises doing multi-user mall system?
Common fault analysis and Countermeasures of using MySQL in go language
Go 语言使用 MySQL 的常见故障分析和应对方法
How to improve the operation efficiency of intra city distribution
OpenGL - Lighting
Thermometer based on STM32 single chip microcomputer (with face detection)
基于模板配置的数据可视化平台
Principle and performance analysis of lepton lossless compression
First understanding of structure
写入速度提升数十倍,TDengine 在拓斯达智能工厂解决方案上的应用
分布式数据库下子查询和 Join 等复杂 SQL 如何实现?
基于宽表的数据建模应用
Tongweb set gzip
【饿了么动态表格】
TDengine 离线升级流程
On July 2, I invite you to TD Hero online press conference
百度交易中台之钱包系统架构浅析
一次 Keepalived 高可用的事故,让我重学了一遍它
观测云与 TDengine 达成深度合作,优化企业上云体验
Viewpager pageradapter notifydatasetchanged invalid problem