当前位置:网站首页>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
边栏推荐
- 【两个对象合并成一个对象】
- The popularity of B2B2C continues to rise. What are the benefits of enterprises doing multi-user mall system?
- Understand the window query function of tdengine in one article
- How Windows bat script automatically executes sqlcipher command
- On July 2, I invite you to TD Hero online press conference
- LeetCode 556. Next bigger element III
- Apache DolphinScheduler 系统架构设计
- Go 语言使用 MySQL 的常见故障分析和应对方法
- A keepalived high availability accident made me learn it again
- Tdengine can read and write through dataX, a data synchronization tool
猜你喜欢

移动端异构运算技术-GPU OpenCL编程(进阶篇)

一文读懂TDengine的窗口查询功能

基于宽表的数据建模应用

A detailed explanation of the general process and the latest research trends of map comparative learning (gnn+cl)

Three-level distribution is becoming more and more popular. How should businesses choose the appropriate three-level distribution system?

百度智能小程序巡檢調度方案演進之路

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

High performance spark_ Transformation performance

Android privacy sandbox developer preview 3: privacy, security and personalized experience

Analysis on the wallet system architecture of Baidu trading platform
随机推荐
Roll up, break through 35 year old anxiety, and animate the CPU to record the function call process
Understand the window query function of tdengine in one article
SQL learning - case when then else
Community group buying has triggered heated discussion. How does this model work?
What are the advantages of the live teaching system to improve learning quickly?
Tdengine offline upgrade process
Principle and performance analysis of lepton lossless compression
Lepton 无损压缩原理及性能分析
The popularity of B2B2C continues to rise. What are the benefits of enterprises doing multi-user mall system?
tongweb设置gzip
La voie de l'évolution du système intelligent d'inspection et d'ordonnancement des petites procédures de Baidu
oracle 多行数据合并成一行数据
【el-table如何禁用】
Dry goods sorting! How about the development trend of ERP in the manufacturing industry? It's enough to read this article
Viewpager pageradapter notifydatasetchanged invalid problem
Thermometer based on STM32 single chip microcomputer (with face detection)
【技术直播】如何用 VSCode 从 0 到 1 改写 TDengine 代码
Mobile heterogeneous computing technology GPU OpenCL programming (Advanced)
移动端异构运算技术-GPU OpenCL编程(进阶篇)
百度智能小程序巡检调度方案演进之路