# How to create an exe file from julia code?

**URL:** <https://discourse.julialang.org/t/how-to-create-an-exe-file-from-julia-code/30004>\
**Category:** General Usage\
**Created:** [October 16, 2019, 11:23pm UTC](https://discourse.julialang.org/t/how-to-create-an-exe-file-from-julia-code/30004 "2019-10-16T23:23:14Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinod\_kc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vinod_kc/32/10857_2.png) [@vinod\_kc](https://discourse.julialang.org/u/vinod_kc)\
**Post date:** [October 16, 2019, 11:23pm UTC](https://discourse.julialang.org/t/how-to-create-an-exe-file-from-julia-code/30004/1 "2019-10-16T23:23:14Z")

</div>

Hi all,  
I am new to julia. I just started loving this language at first sight, Elegant ! My area of interest is windows desktop applications. I just set up all the beginning steps in atom and execute my Hello World app. But now, i want to convert this code to an exe file. There is no use of julia for me if i cannot create an exe file. Please help me.

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [October 16, 2019, 11:39pm UTC](https://discourse.julialang.org/t/how-to-create-an-exe-file-from-julia-code/30004/2 "2019-10-16T23:39:05Z")

</div>

this is the most feared question of the community at the moment, there’s no ‘real-world usable’ approach – just like python, unless you just [ask user to](https://docs.spyder-ide.org/installation.html) have python or course. The closest you can get is: [GitHub - JuliaLang/PackageCompiler.jl: Compile your Julia Package](https://github.com/JuliaLang/PackageCompiler.jl)

also see discussion here:

> [@Compiling and building binaries from your julia code](https://discourse.julialang.org/t/compiling-and-building-binaries-from-your-julia-code/5687):
>
> I put together a repository on how to compile binaries and shared libraries from your user code - with lots of help from Jameson. [https://github.com/JuliaComputing/static-julia](https://github.com/JuliaComputing/static-julia) The instructions are in the README, and are hopefully straightforward. The juliac.jl script is also simple and easy to inspect and modify. [https://github.com/JuliaComputing/static-julia/blob/master/README.md](https://github.com/JuliaComputing/static-julia/blob/master/README.md) The hello.jl in this repo gets compiled into a hello binary, and can be executed like any other OS binary. I ha…

---

<div class="post-metadata">

**Author:** ![vinod\_kc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vinod_kc/32/10857_2.png) [@vinod\_kc](https://discourse.julialang.org/u/vinod_kc)\
**Post date:** [October 17, 2019, 12:02am UTC](https://discourse.julialang.org/t/how-to-create-an-exe-file-from-julia-code/30004/3 "2019-10-17T00:02:56Z")

</div>

Thanks for the quick reply. I have read the instructions on the github page of PackageCompiler. But some points are not very clear,  
Where i need to put the ArgParse ? I am strck without proper information  
My cmd window says that Package PackageCompiler is not found in current path. I dont know wich path. I am confused. Please help.

---

<div class="post-metadata">

**Author:** ![vinod\_kc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vinod_kc/32/10857_2.png) [@vinod\_kc](https://discourse.julialang.org/u/vinod_kc)\
**Post date:** [October 17, 2019, 12:13am UTC](https://discourse.julialang.org/t/how-to-create-an-exe-file-from-julia-code/30004/4 "2019-10-17T00:13:08Z")

</div>

Lot of information are given in github page of PackageCompiler. But i didnt understand that where i can use the "build\_executable(“hello.jl”, “hello”) command. In CMD or in Julia prompt ?

---

<div class="post-metadata">

**Author:** ![thautwarm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thautwarm/32/37760_2.png) [@thautwarm](https://discourse.julialang.org/u/thautwarm)\
**Post date:** [October 17, 2019, 1:55am UTC](https://discourse.julialang.org/t/how-to-create-an-exe-file-from-julia-code/30004/5 "2019-10-17T01:55:17Z")

</div>

Hi, it’s Julia prompt

---

<div class="post-metadata">

**Author:** ![Ajaychat3](https://avatars.discourse-cdn.com/v4/letter/a/ecd19e/32.png) [@Ajaychat3](https://discourse.julialang.org/u/Ajaychat3)\
**Post date:** [October 17, 2019, 4:12am UTC](https://discourse.julialang.org/t/how-to-create-an-exe-file-from-julia-code/30004/6 "2019-10-17T04:12:39Z")

</div>

I have tried but it does not work.

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [October 17, 2019, 6:38am UTC](https://discourse.julialang.org/t/how-to-create-an-exe-file-from-julia-code/30004/7 "2019-10-17T06:38:07Z")

</div>

Why do you NEED an exe? (Just curious.)

---

<div class="post-metadata">

**Author:** ![Fred](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fred/32/14175_2.png) [@Fred](https://discourse.julialang.org/u/Fred)\
**Post date:** [October 17, 2019, 8:29am UTC](https://discourse.julialang.org/t/how-to-create-an-exe-file-from-julia-code/30004/8 "2019-10-17T08:29:38Z")

</div>

@PetrKryslUCSD, exe file are very useful to share tools with people that are not computer scientist and have never done a single program. Moreover some packages are not always retro compatible and a software can stop running after an update. (the problem is the same with R). For this reason I often make the choice to use Go and cross-compilation instead of Julia (even if I program faster in Julia).

---

<div class="post-metadata">

**Author:** ![jbrea](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jbrea/32/3879_2.png) [@jbrea](https://discourse.julialang.org/u/jbrea)\
**Post date:** [October 17, 2019, 8:46am UTC](https://discourse.julialang.org/t/how-to-create-an-exe-file-from-julia-code/30004/9 "2019-10-17T08:46:15Z")

</div>

> [@Fred](#):
>
> Moreover some packages are not always retro compatible and a software can stop running after an update.

This is why we have Manifest.toml files, that allow to specify exactly the version of the package we would like to use.

Given that the installation of julia binaries is very easy across many platforms I wonder, if it wouldn’t be an easy solution to write a little script for each platform that downloads the julia binaries and the package/script you want to share and potentially even a clickable script to run your julia code.  
If it is just for sharing I don’t see a reason for exe file.

But exe files have other advantages, like shorter “time to first plot”.

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [October 17, 2019, 8:46am UTC](https://discourse.julialang.org/t/how-to-create-an-exe-file-from-julia-code/30004/10 "2019-10-17T08:46:24Z")

</div>

> [@Fred](#):
>
> and have never done a single program. Moreover some packages are not always retro compatible and a software can stop running after an update.

I think this problem would be solved if you were to distribute Julia with a package environment. The environment can take care of the proper versions of all the packages.  
On Windows, one could distribute a batch file that would run Julia, set up the environment, and run the Julia code.

---

<div class="post-metadata">

**Author:** ![Fred](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fred/32/14175_2.png) [@Fred](https://discourse.julialang.org/u/Fred)\
**Post date:** [October 17, 2019, 9:07am UTC](https://discourse.julialang.org/t/how-to-create-an-exe-file-from-julia-code/30004/11 "2019-10-17T09:07:03Z")

</div>

@jbrea thank you very much for your answer, I did not try Manifest.toml and I will have a look 😉

To give you more details about some problems I had with sharing Julia tools in the past (I confess that I only use Linux and MS windows is a nightmare for me) :  
I had for example some windows 7 users that did not manage to install some Julia package because for some reasons a version of windows 7 could not access to github without a Microsoft patch, when I tested this patch it was not working…

On the same platform when some Julia version (I don’t remember the number) was uninstalled, and a new version was installed, it was not possible to make a link between .jl files and the julia.exe file, because the uninstall software did not remove all the entries in the registry database. As a result when the user click on the jl file it was not working. So it was necessary to clean that by hand using regedit, and then do a fresh install, so imagine how all this is difficult for somebody with very limited computer skills, he just gives up…

With a simple exe in go the user click and it works and I don’t have to study all the windows-related problems 🙂

---

<div class="post-metadata">

**Author:** ![jbrea](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jbrea/32/3879_2.png) [@jbrea](https://discourse.julialang.org/u/jbrea)\
**Post date:** [October 17, 2019, 9:13am UTC](https://discourse.julialang.org/t/how-to-create-an-exe-file-from-julia-code/30004/12 "2019-10-17T09:13:14Z")

</div>

I see. Yeah, that sounds annoying. I never tried sharing with Windows users so far, but I am warned now…

---

<div class="post-metadata">

**Author:** ![Zach\_Christensen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zach_christensen/32/7220_2.png) [@Zach\_Christensen](https://discourse.julialang.org/u/Zach_Christensen)\
**Post date:** [October 17, 2019, 9:15am UTC](https://discourse.julialang.org/t/how-to-create-an-exe-file-from-julia-code/30004/13 "2019-10-17T09:15:28Z")

</div>

I know there has been talk on Slack about fixing some Windows problems, but it’s hard to imagine support for Windows 7 will ever be what it is on Linux.

---

<div class="post-metadata">

**Author:** ![Fred](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fred/32/14175_2.png) [@Fred](https://discourse.julialang.org/u/Fred)\
**Post date:** [October 17, 2019, 9:20am UTC](https://discourse.julialang.org/t/how-to-create-an-exe-file-from-julia-code/30004/14 "2019-10-17T09:20:15Z")

</div>

@Zach_Christensen, of course I continue using Julia because it is one of my favorite language 😉

I recently install one of my tool on windows 10 and everything worked fine (package download was easy) so I have the feeling that the situation has improved (but I did not try to desintall - reinstall Julia to see if the .jl file can be linked with the new julia.exe file)

---

<div class="post-metadata">

**Author:** ![vinod\_kc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vinod_kc/32/10857_2.png) [@vinod\_kc](https://discourse.julialang.org/u/vinod_kc)\
**Post date:** [October 17, 2019, 12:01pm UTC](https://discourse.julialang.org/t/how-to-create-an-exe-file-from-julia-code/30004/15 "2019-10-17T12:01:21Z")

</div>

Ok. Thanks

---

<div class="post-metadata">

**Author:** ![vinod\_kc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vinod_kc/32/10857_2.png) [@vinod\_kc](https://discourse.julialang.org/u/vinod_kc)\
**Post date:** [October 17, 2019, 12:03pm UTC](https://discourse.julialang.org/t/how-to-create-an-exe-file-from-julia-code/30004/16 "2019-10-17T12:03:15Z")

</div>

In windows, if you double clicked on a julia file, it won’t work. We need exe file for that,

---

<div class="post-metadata">

**Author:** ![Fred](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fred/32/14175_2.png) [@Fred](https://discourse.julialang.org/u/Fred)\
**Post date:** [October 17, 2019, 12:19pm UTC](https://discourse.julialang.org/t/how-to-create-an-exe-file-from-julia-code/30004/17 "2019-10-17T12:19:42Z")

</div>

@vinod_kc The first time you click on a .jl file on windows, you have to link it with julia.exe binary. Then, Julia will start automatically when you click on a .jl file 🙂

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [October 17, 2019, 12:24pm UTC](https://discourse.julialang.org/t/how-to-create-an-exe-file-from-julia-code/30004/18 "2019-10-17T12:24:51Z")

</div>

No, you don’t. See below. Also, you can distribute a batch file, which will call Julia etc.

---

<div class="post-metadata">

**Author:** ![vinod\_kc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vinod_kc/32/10857_2.png) [@vinod\_kc](https://discourse.julialang.org/u/vinod_kc)\
**Post date:** [October 17, 2019, 12:32pm UTC](https://discourse.julialang.org/t/how-to-create-an-exe-file-from-julia-code/30004/19 "2019-10-17T12:32:41Z")

</div>

I am a hobby programmer. I tried python and quit later. Now i am using, [VB.Net](http://VB.Net), Nim, D, & Rust. I am interested to experiment with new languages but if it is not capable to make an exe, then it is useless for me. I can’t even send the programs to my friends to try. However, i love the syntax of Julia.

---

<div class="post-metadata">

**Author:** ![vinod\_kc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vinod_kc/32/10857_2.png) [@vinod\_kc](https://discourse.julialang.org/u/vinod_kc)\
**Post date:** [October 17, 2019, 12:35pm UTC](https://discourse.julialang.org/t/how-to-create-an-exe-file-from-julia-code/30004/20 "2019-10-17T12:35:00Z")

</div>

If i send the “Myprogram.jl” and a batch file to my friend who had not installed Julia on his/her machine, then does it work ?

[Next page](https://discourse.julialang.org/t/how-to-create-an-exe-file-from-julia-code/30004.md?page=2)
