当前位置:网站首页>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
边栏推荐
- LeetCode 496. 下一个更大元素 I
- Go 语言使用 MySQL 的常见故障分析和应对方法
- Apache DolphinScheduler 入门(一篇就够了)
- 使用el-upload封装得组件怎么清空已上传附件
- Mobile heterogeneous computing technology GPU OpenCL programming (Advanced)
- SQL learning alter add new field
- 基于模板配置的数据可视化平台
- Lepton 无损压缩原理及性能分析
- Uncover the practice of Baidu intelligent testing in the field of automatic test execution
- Solve the problem of no all pattern found during Navicat activation and registration
猜你喜欢
The research trend of map based comparative learning (gnn+cl) in the top paper
百度智能小程序巡檢調度方案演進之路
OpenGL - Coordinate Systems
写入速度提升数十倍,TDengine 在拓斯达智能工厂解决方案上的应用
90%的人都不懂的泛型,泛型的缺陷和应用场景
[team PK competition] the task of this week has been opened | question answering challenge to consolidate the knowledge of commodity details
How to empty uploaded attachments with components encapsulated by El upload
单片机原理与接口技术(ESP8266/ESP32)机器人类草稿
E-commerce apps are becoming more and more popular. What are the advantages of being an app?
cent7安装Oracle数据库报错
随机推荐
解决Navicat激活、注册时候出现No All Pattern Found的问题
代码语言的魅力
The writing speed is increased by dozens of times, and the application of tdengine in tostar intelligent factory solution
90%的人都不懂的泛型,泛型的缺陷和应用场景
卷起來,突破35歲焦慮,動畫演示CPU記錄函數調用過程
【组队 PK 赛】本周任务已开启 | 答题挑战,夯实商品详情知识
【js 根据对象数组中的属性进行排序】
Cloud computing technology hotspot
How Windows bat script automatically executes sqlcipher command
百度智能小程序巡检调度方案演进之路
A detailed explanation of the general process and the latest research trends of map comparative learning (gnn+cl)
How to implement complex SQL such as distributed database sub query and join?
Solve liquibase – waiting for changelog lock Cause database deadlock
Develop and implement movie recommendation applet based on wechat cloud
Mobile heterogeneous computing technology GPU OpenCL programming (Advanced)
The research trend of map based comparative learning (gnn+cl) in the top paper
Application of data modeling based on wide table
First understanding of structure
百度交易中台之钱包系统架构浅析
Unity skframework framework (XXIII), minimap small map tool