http://www.lighting-torch.com/2015/07/27/configuring-eclipse-with-torch/
1、安装eclipse
在我的另一篇博客中有详细的安装教程:
http://blog.csdn.net/gyguo95/article/details/78937573
2、安装 Lua IDEs
参考Lua Development Tools (LDT)的官方网站
参考:http://www.lighting-torch.com/2015/07/27/configuring-eclipse-with-torch/
- 打开Eclipse,选择 Help > Install New Software
- 点击右上角的Add,使用网址:http://download.eclipse.org/ldt/releases/stable
- Lua Developments Tools
前面的勾是必选,Lua Development Tools – Remote Development Support
、Lua Development Tools – Remote Development Support SDK
、Lua Development Tools SDK
根据自己需求选择,之后点击下面的 next
- 安装之后重启eclipse完成
3、设置Lua
- 点击Windows –> Preference -> Lua
- 点击
Execution Environment
选择lua-5.2
- 点击
Grammars
选择lua-5.2
- 点击
Interpreters
选择lua-5.2
4、新建一个的Lua项目
File–>New–>Lua Project
- 输入project name
- 选择工作空间
- target environment/grammar 为lua-5.2
- 点击next
- 接下来可以设置外部依赖,这里可以不用设置
- 点击 Finish
5、设置Torch为Lua默认解释器
- 安装外部依赖包
luarocks install luasocket #需要联网
sudo apt-get install libcanberra-gtk-module
在eclipse中设置 - Windows–>Project–>Preference -> Lua
- Interpreters –> Add
- Interpreter type : Lua 5.2 *
- Interpreter executable : 选择lua的安装路径,一般情况下,在
~/torch/install/bin/qlua
,可以使用which th
来确定 - Interpreter name:Torch
- Interpreter arguments : 在
-e
前添加-lenv
和一个空格 - Linked Execution Environment : Lua-5.2
- 点击ok确认
- 将上一步新建的解释器Torch设置为默认的解释器