Setting Up A Julia Development Environment

Setting Up A Julia Development Environment

Introduction

This guide explains how to get Julia running in VS Code. So it is assumed that you have the IDE (Integrated Development Environment) installed on your machine. If not you can download VS Code here.

Installation Steps

  1. Download and Install Julia: As recommended on the official Julia website, you should be downloading and using Julia's latest stable release for your operating system. After downloading, run the installer and follow the instructions.

  2. Install the Julia Extension: you can find the extension here or you could directly search the term julia in the extension marketplace. It should be the first popping up with "Julia Language Support" as the description. The extension provides language support and other features like syntax highlighting, code completion, and debugging.

  3. Test Your Setup: To make sure your setup is working correctly, open VS Code and create a new file with a .jl extension, main.jl for example. Then write your first line of Julia, such as println("Hello, world!"). Save the file and run it by clicking the "play" button at the top right corner in VS Code.

If you're getting an error message that reads like this:

Cannot read properties of undefined.

It might be that the extension does not find the julia executable. You can fix this by setting the julia.executablePath to point to julia.exe on your machine. You can set the path via the menu File->Preferences->Settings->Extensions and then select Julia. Under Julia go to Julia: Executable Path and enter the path.

You can find the right path by searching julia.exe, opening the file location and copying the path, which should look something like this:

C:\Users\moyoj\AppData\Local\Programs\Julia-1.8.5\bin\julia.exe

And your Julia program should run successfully.


I hope that this article is helpful and you learned something from it. Being a technical writer and content creator I am passionate about sharing my knowledge (including tips and advice) and helping other people achieve their goals, especially those just starting in tech. You can connect with me on my social media profiles and blogs here.