[JAVA] Output Hello World in kotlin's simple main function

Install Kotlin on your Mac using Homebrew.

$ brew install kotlin
$ kotlin -version
=> Kotlin version 1.3.61-release-180 (JRE 11.0.1+13-LTS)

Write a simple Hello World in Kotlin


fun main(args: Array<String>) { 
  println("Hello, World!")

Compile the above kt file with Kotlin Compiler

$ kotlinc helloWorld.kt -include-runtime -d helloWorld.jar
$ hello_world ll
-rw-r--r--  1 user staff   1.3M Dec 27 22:34 helloWorld.jar
-rw-r--r--  1 user staff    62B Dec 27 22:33 helloWorld.kt

Execute the jar file with the java command

$ java -jar helloWorld.jar
=> Hello, World!

Hello, World!

Recommended Posts

Output Hello World in kotlin's simple main function
"Hello World" in Java
Hello world in node.js
Hello World in Java
Spring Boot Hello World in Eclipse
Implement simple login function in Rails
Hello World in java in eclipse now
hello, world in Vanilla Java-EHW2018 "MVP"
Hello world in Java and Gradle
Hello, World! In the bootstrap loader area
[Practice! ] Display Hello World in Spring Boot
"Hello, World!" With Kotlin + CLI in 5 minutes
"Teacher, I want to implement a login function in Spring" ① Hello World
Hello World with JavaFX 11 (OpenJFX) in Liberica JDK 11
Build Java environment and output hello world [Beginner]
Until you install Gradle and output "Hello World"
Display "Hello World" in the browser using Java
Display "Hello World" in the browser using Java
Show a simple Hello World with SpringBoot + IntelliJ
Wastefully creative "Hello World" output method list (Java)
Simple notification function in Rails (only when followed)
Read "Hello world"
Java, Hello, world!
Java Hello World