Compile & Run Kotlin using Visual Studio Code
- Kotlin (Command Line) & VS Code are already installed on your system.
- Enviornment Variable for Kotlin Compiler is set.
- Open Terminal & navigate to your project folder and execute following command.
git clone https://github.com/pavittarx/kotlin-vscode.git && xcopy /E kotlin-vscode && rm -rf kotlin-vscode
- If you want Keyboard Shortcuts, Copy & Paste content or 'keybindings' file provided to your keybindings.json File > Prefrences > Keyboard Shortcuts > Open & edit keybindings.json
If Keybindins are not set.
- Open Command Palette (F1 or Ctrl+Shift+K)
- Search for 'Tasks:Run Build Tasks' (Ctrl+Shift+B)
- Choose an option (Compile/Run/Compile+Run) from the list provided.
If Keybindings are set
F9 - Compile+Run Kotlin Code
F10 - Compile Kotlin Code
F11 - Run Kotlin Application Binary
F12 - Lists the Available Tasks (same as Ctrl+Shift+B)
- The following only works on Windows Systems as of this moment.
- A test file 'hello.kt' is compiled as of this moment, you can edit kotlin/compile.cmd & change it to your own file.
- The compilerun.cmd must be edited to match your kotlin (.kt) file if you use Compile+Run