Skip to content

Commit 61aeaf6

Browse files
authored
update: java version note (#4286)
1 parent 3bf305a commit 61aeaf6

File tree

1 file changed

+25
-18
lines changed

1 file changed

+25
-18
lines changed
Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,50 @@
11
[//]: # (title: Get started with Kotlin/Native using the command-line compiler)
22

3-
## Obtain the compiler
3+
## Download and install the compiler
44

5-
The Kotlin/Native compiler is available for macOS, Linux, and Windows. It is available as a command line tool and ships
6-
as part of the standard Kotlin distribution and can be downloaded from [GitHub Releases](%kotlinLatestUrl%). It supports
7-
different targets including Linux, macOS, iOS, and others. [See the full list of supported targets](native-target-support.md).
5+
The Kotlin/Native compiler works on macOS, Linux, and Windows. It's available as a command line tool and ships
6+
as part of the standard Kotlin distribution. You can download it from our [GitHub Releases](%kotlinLatestUrl%) page.
7+
8+
The compiler supports different targets including Linux, macOS, iOS, and others. [See the full list of supported targets](native-target-support.md).
89
While cross-platform compilation is possible, which means using one platform to compile for a different one,
9-
in this %product% case we'll be targeting the same platform we're compiling on.
10+
in this case, you'll be targeting the same platform you're compiling on.
1011

11-
While the output of the compiler does not have any dependencies or virtual machine requirements,
12-
the compiler itself requires [Java 1.8 or higher runtime](https://jdk.java.net/11/).
12+
> Although the output of the compiler doesn't have any dependencies or virtual machine requirements, the compiler itself
13+
> requires Java 1.8 or higher runtime. It's supported by [JDK 8 (JAVA SE 8) or later versions](https://www.oracle.com/java/technologies/downloads/).
14+
>
15+
{type="note"}
1316

14-
Install the compiler by unpacking its archive to a directory of your choice and adding the path to its `/bin` directory
17+
To install the compiler, unpack its archive to a directory of your choice and add the path to its `/bin` directory
1518
to the `PATH` environment variable.
1619

17-
## Write "Hello Kotlin/Native" program
20+
## Write "Hello, Kotlin/Native" program
1821

19-
The application will print "Hello Kotlin/Native" on the standard output. In a working directory of choice, create a file named
20-
`hello.kt` and enter the following contents:
22+
The application will print "Hello, Kotlin/Native" on the standard output.
23+
Choose a working directory and create a file there named `hello.kt`. Update it with the following code:
2124

2225
```kotlin
2326
fun main() {
24-
println("Hello Kotlin/Native!")
27+
println("Hello, Kotlin/Native!")
2528
}
2629
```
2730

2831
## Compile the code from the console
2932

30-
To compile the application use the [downloaded](https://github.com/JetBrains/kotlin/releases)
31-
compiler to execute the following command:
33+
To compile the application, execute the following command with the [downloaded](https://github.com/JetBrains/kotlin/releases)
34+
compiler:
3235

3336
```bash
3437
kotlinc-native hello.kt -o hello
3538
```
3639

3740
The value of `-o` option specifies the name of the output file, so this call should generate a `hello.kexe` (Linux and macOS)
38-
or `hello.exe` (Windows) binary file.
39-
For the full list of available compiler options, see the [compiler options reference](compiler-reference.md).
41+
or `hello.exe` (Windows) binary file. For the full list of available options, see [Kotlin compiler options](compiler-reference.md).
4042

4143
While compilation from the console seems to be easy and clear, it
42-
does not scale well for larger projects with hundreds of files and libraries. For real-world projects, it is recommended
43-
to use a [build system](native-gradle.md) and [IDE](native-get-started.md).
44+
doesn't scale well for larger projects with hundreds of files and libraries. For real-world projects, it is recommended
45+
to use a [build system](native-gradle.md) and an [IDE](native-get-started.md).
46+
47+
## Run the program
48+
49+
To run the program, in your command line tool, navigate to the directory containing the `hello.kexe` (or `hello.exe`) file
50+
and run the `./hello.kexe` (or `./hello.exe`) command. The application should print "Hello, Kotlin/Native" on the standard output.

0 commit comments

Comments
 (0)