Roshad Guerrier
12/14/2021, 11:20 PMedrd
12/15/2021, 12:28 AMRoshad Guerrier
12/15/2021, 2:38 AMkotlinc-native hello.kt -o hello
I’m following this page: Write "Hello Kotlin/Native" program
The error I’m getting is zsh: command not found: kotlinc-native
This is my kotlin version: Kotlin version 1.6.10-release-923 (JRE 16.0.2+7)
Emil Kantis
12/15/2021, 7:29 AMInstall the compiler by unpacking its archive to a directory of your choice and adding the path to itsThe error message suggests you didn’t do this correctlydirectory to the/bin
environment variable.PATH
Emil Kantis
12/15/2021, 7:30 AMecho $PATH
.
which kotlinc-native
should show the path where you put the compilerRoshad Guerrier
12/15/2021, 9:23 PMecho $PATH which kotlinc-native
?Emil Kantis
12/15/2021, 9:24 PMecho $PATH
shows your current PATH env, on which there should be one path to the bin-folder for kotlinc-native
Roshad Guerrier
12/15/2021, 9:25 PM/Library/Frameworks/Python.framework/Versions/3.9/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
Emil Kantis
12/15/2021, 9:26 PMRoshad Guerrier
12/15/2021, 9:27 PM/Users/roshad/Kotlin/kotlinc/bin
Should I use nano and add this to my /etc/paths?Emil Kantis
12/15/2021, 9:29 PMexport PATH=$PATH:/Users/roshad/Kotlin/kotlinc/bin
to the file /Users/roshad/.zshrc
and restart your terminal and it should be goodEmil Kantis
12/15/2021, 9:30 PMkotlinc-native
in this case, is a file which you added in /Users/roshad/Kotlin/kotlinc/bin
)Roshad Guerrier
12/15/2021, 9:34 PMRoshad Guerrier
12/15/2021, 9:35 PMRoshad Guerrier
12/15/2021, 9:36 PM/Library/Frameworks/Python.framework/Versions/3.9/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/roshad/Kotlin/kotlinc/bin:/Users/roshad/Kotlin/kotlinc/bin
Emil Kantis
12/15/2021, 9:38 PMkotlin-compiler-$Version.zip
.. try downloading the kotlin-native-macos
appropriate for your machine (aarch64 for M1 macbooks, x86_64 otherwise) insteadRoshad Guerrier
12/15/2021, 9:44 PMEmil Kantis
12/15/2021, 9:46 PMRoshad Guerrier
12/15/2021, 9:51 PMexport PATH=$PATH:/Users/roshad/Kotlin/kotlin-native/bin
Roshad Guerrier
12/15/2021, 9:52 PMRoshad Guerrier
12/15/2021, 9:53 PMkotlin-native-macos-aarch64-1.6.10
to kotlin-native
in my Kotlin folder.Roshad Guerrier
12/15/2021, 9:54 PM