English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Lua Environment Installation

Lua Installation on Linux System

Lua installation on Linux & Mac is very simple, just download the source code package and decompress and compile it in the terminal. This article uses5.3Install version .0:

curl -R -O http://www.lua.org/ftp/lua-5.3.0.tar.gz
tar zxf lua-5.3.0.tar.gz
cd lua-5.3.0
make linux test
make install

Lua Installation on Mac OS X System

curl -R -O http://www.lua.org/ftp/lua-5.3.0.tar.gz
tar zxf lua-5.3.0.tar.gz
cd lua-5.3.0
make macosx test
make install

On Mac, you can also install it through homebrew for version management.

brew install lua

Next, we create a HelloWorld.lua file with the following code:

print("Hello World!")

Execute the following command:

$ lua HelloWorld.lua

The output result is:

Hello World!

Lua Installation on Windows System

On Windows, you can use an IDE environment called "SciTE" to execute Lua programs, download address is:

Double-click to install and you can write and run Lua programs in this environment.

You can also use the method recommended by the Lua official website to use LuaDist:http://luadist.org/