This guide is intended for new or beginner-level users who are new to the Visual Studio (VS) Code extension. The getting started tasks use the Julia programming language to create a “Hello World” program in VS Code.
- VS Code
- VS Code Julia extension
Download the latest stable version of Julia, based on the platform you are using, from the Julia homepage.
Download and install VS Code, based on the platform you are using, from the VS Code homepage.
- Start or open Visual Studio Code.
- Select View and then click Extensions to open Extension View.
- Enter the term
juliain the marketplace search box. Click the green Install button to download the extension.
You successfully downloaded the Julia extension for VS Code.
NOTE: It is recommended that you restart VS Code after installation.
If you installed Julia into a standard location on Mac or Windows, or if the Julia binary is on your
PATH, the Julia VS Code extension automatically finds your Julia installation. You do not need to configure the extension. Continue onto the next section.
If the VS Code extension does not find your Julia installation automatically, or you want to use a different Julia installation than the default one, use the following steps to configure the extension.
- Set the
julia.executablePathto the full path of Julia executable that the extension should use.
- To edit your configuration settings, select File, then select Preferences, and then click Settings. Ensure that your user settings include the
NOTE: The format of the string should follow your platform specific conventions. Note that the backslash
\ is the escape character in JSON, therefore use
\\ as the path separator character on Windows.
- From the File Explorer toolbar, click the New File button on the
- Name the file
hello.jl, and it automatically opens in the editor.
The .jl file extension indicates to VS Code that you interpret this file as a Julia program, therefore it evaluates the contents with the Julia extension and the selected interpreter.
- Enter the following source code in hello.jl:
msg = "Hello World" println(msg)
To run the Hello World program, click Run: Julia File in Terminal play button in the top-right side of the editor.
You can see the corresponding output in the terminal.
Congratulations! You have just completed your first Julia program.