Julia, Software Development

Install Julia And Run Source Code Files In Windows

This post is about how to install Julia and run source code files in Windows. Once we install it, we need to configure it a bit to make the Julia executable file available in command-line windows.

Download And Install Julia

Julia has two types of release – current stable and LTS. The current version is 1.4.0. We can download binaries built for Windows, macOS, Generic Linux, and FreeBSD.

For this post, choose current stable  – either Windows 32-bit or 64-bit – to download. Run the installer, and the following window will appear. Then, click Install. Wait until the installation completes.

Skip Run Julia and Click Finish.

Run Julia Source Codes In Windows

After we installed julia, we need to configure it a bit to be able to run source code files. Otherwise, we get an error, as shown below,

we get the following error.

This means the path to the julia.exe is not found in the environment variable PATH.

There are two ways to fix this in Windows 10. After this, we can run Julia source code files in any command-line window.

Option 1

This option may need to restart Windows.

  1.  Go to Control Panel
  2.  Go to System And Security
  3.  Go to System
  4.  Go to Advanced system settings
  5.  Click Environment Variables
  6.  Click System Variables
  7. Look for the PATH variable and select it
  8. Update the value of PATH by appending the path to ;C:\Users\user123\AppData\Local\Programs\Julia\Julia-1.4.0\bin.

Option 2

For this option, we need to do this when we open a new command-line window. First, run the following command.

Then, we can now use the julia command. The output is something like the following.

Run Julia Source Code File

Now, it is time to run Julia source code files. We have two identical files, but they only differ in the file name extension. All files are in C:\Users\user123\Desktop\julia-codes.

To run each file, use either one of the following commands in the command-line window.

As we can see, the source code files do not know have specific file extensions.

Got comments or suggestions? We disabled the comments on this site to fight off spammers, but you can still contact us via our Facebook page!.

You Might Also Like