当前位置:网站首页>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
边栏推荐
- MYSQL 对字符串类型排序不生效问题
- [app packaging error] to proceed, either fix the issues identified by lint, or modify your build script as follow
- TDengine × Intel edge insight software package accelerates the digital transformation of traditional industries
- Three-level distribution is becoming more and more popular. How should businesses choose the appropriate three-level distribution system?
- Deep understanding of C language pointer
- 【sourceTree配置SSH及使用】
- 解决Navicat激活、注册时候出现No All Pattern Found的问题
- H. 265 introduction to coding principles
- 【OpenCV 例程200篇】219. 添加数字水印(盲水印)
- Tdengine offline upgrade process
猜你喜欢

Officially launched! Tdengine plug-in enters the official website of grafana

Oracle combines multiple rows of data into one row of data

Dry goods sorting! How about the development trend of ERP in the manufacturing industry? It's enough to read this article

Solve liquibase – waiting for changelog lock Cause database deadlock

LeetCode 496. Next larger element I

Principle and performance analysis of lepton lossless compression

How do enterprises choose the appropriate three-level distribution system?

Project practice | excel export function

Why does everyone want to do e-commerce? How much do you know about the advantages of online shopping malls?

Develop and implement movie recommendation applet based on wechat cloud
随机推荐
Why do offline stores need cashier software?
uni-app---uni. Navigateto jump parameter use
[sorting of object array]
Unity skframework framework (XXIII), minimap small map tool
Viewpager pageradapter notifydatasetchanged invalid problem
Understand the window query function of tdengine in one article
SMT32H7系列DMA和DMAMUX的一点理解
使用el-upload封装得组件怎么清空已上传附件
Idea debugs com intellij. rt.debugger. agent. Captureagent, which makes debugging impossible
Cross process communication Aidl
[NTIRE 2022]Residual Local Feature Network for Efficient Super-Resolution
MySQL does not take effect in sorting string types
TDengine ×英特尔边缘洞见软件包 加速传统行业的数字化转型
Tdengine already supports the industrial Intel edge insight package
百度APP 基于Pipeline as Code的持续集成实践
Wechat applet obtains household area information
Android privacy sandbox developer preview 3: privacy, security and personalized experience
[hungry dynamic table]
The writing speed is increased by dozens of times, and the application of tdengine in tostar intelligent factory solution
idea用debug调试出现com.intellij.rt.debugger.agent.CaptureAgent,导致无法进行调试