当前位置:网站首页>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
边栏推荐
- Unity skframework framework (24), avatar controller third person control
- Wechat applet obtains household area information
- Three-level distribution is becoming more and more popular. How should businesses choose the appropriate three-level distribution system?
- 【js 根据对象数组中的属性进行排序】
- H.265编码原理入门
- Tongweb set gzip
- Resolve the horizontal (vertical) sliding conflict between viewpager and WebView
- LeetCode 556. Next bigger element III
- Mobile heterogeneous computing technology GPU OpenCL programming (Advanced)
- La voie de l'évolution du système intelligent d'inspection et d'ordonnancement des petites procédures de Baidu
猜你喜欢

How Windows bat script automatically executes sqlcipher command

MySQL installation configuration and creation of databases and tables

Online chain offline integrated chain store e-commerce solution

tongweb设置gzip

22-07-04 Xi'an Shanghao housing project experience summary (01)

干货整理!ERP在制造业的发展趋势如何,看这一篇就够了

使用el-upload封装得组件怎么清空已上传附件

What should we pay attention to when entering the community e-commerce business?

Android 隐私沙盒开发者预览版 3: 隐私安全和个性化体验全都要

植物大战僵尸Scratch
随机推荐
揭秘百度智能测试在测试自动执行领域实践
从“化学家”到开发者,从甲骨文到TDengine,我人生的两次重要抉择
Small program startup performance optimization practice
uni-app---uni.navigateTo跳转传参使用
百度智能小程序巡檢調度方案演進之路
Roll up, break 35 - year - old Anxiety, animation Demonstration CPU recording Function call Process
正式上架!TDengine 插件入驻 Grafana 官网
百度智能小程序巡检调度方案演进之路
【el-table如何禁用】
Baidu app's continuous integration practice based on pipeline as code
植物大战僵尸Scratch
About getfragmentmanager () and getchildfragmentmanager ()
STM32 simple multi-level menu (array table lookup method)
ThreadLocal source code learning
[technical live broadcast] how to rewrite tdengine code from 0 to 1 with vscode
[sorting of object array]
[NTIRE 2022]Residual Local Feature Network for Efficient Super-Resolution
百度APP 基于Pipeline as Code的持续集成实践
【两个对象合并成一个对象】
【C语言】动态内存开辟的使用『malloc』