首次使用Lua设置Eclipse [英] Setting up Eclipse with Lua for the first time

查看:143
本文介绍了首次使用Lua设置Eclipse的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试首次设置 Lua开发工具/ Koneki 。我是Eclipse的新手,但我之前已经从命令行制作了一堆Lua程序。



希望我的问题是一个通用的Eclipse,有人可能会



我做了什么:



下载LDT后,我遵循了简短的设置指南。我下载了建议的 Lua 5.1 zip 。我按照设置指南添加了5.1作为执行环境。



问题:



我不能运行任何Lua项目。当我打绿色Run或Debug按钮时,Koneki说:这个选择不能启动,最近没有启动。看来这是一个通用的Eclipse错误。



当我单击运行按钮上的下拉箭头时,只有运行配置可用,运行配置窗格我无法添加运行配置,新建按钮是灰色的。






请有人提供更多关于如何在Eclipse中调试或修复这种错误?我得到的感觉,我错过了一些可能对知道Eclipse的人很明显的一些步骤。

解决方案

我不使用这是一个lua编译器 - 我使用它来运行嵌入式lua,所以当我试图启动一个控制台脚本,我得到了相同的结果。



这是我做的 - 不确定它是否是最好的方法,但它的作品



单击运行/外部工具/外部工具配置...
弹出一个对话框
放入

 名称:lua 
位置:/ usr / local / bin / lua
工作目录: $ {container_loc}
参数:$ {resource_name}

然后点击绿色运行下拉然后选择运行配置,然后在对话框中,通过单击右侧的添加按钮添加新配置,并在程序列表下选择lua。单击应用。



现在,当您选择main.lua并单击播放时,它会运行您选择的lua脚本。然后在这样做之后,我想如果我阅读手册,肯定会发生什么:-)。点击帮助和帮助内容,然后在帮助中查看LDT用户指南,它告诉你该做什么,比上述更优雅。



希望这将让你开始。欢呼。



[更新:我尝试了以下手册,它适用于我。我打印了,选择了main.lua并点击了绿色按钮,并在下面的控制台输出中打印了你的输入。

 本地功能main()
printhello
end
main()

[Update2:不需要外部配置的东西,即使遵循手册]


I'm trying to set up the Lua Development Tools / Koneki for the first time. I'm new to Eclipse, but I've made a bunch of Lua programs from the command line before.

Hopefully my problem is a generic Eclipse one that someone might be able to help with.

What I did:

After downloading LDT, I followed the short set-up guide. I downloaded the suggested Lua 5.1 zip. I added 5.1 as an execution environment following the set-up guide.

Problem:

I cannot run any Lua projects. When I hit the green Run or Debug buttons, Koneki says "This selection cannot be launched, and there are no recent launches." It seems this is a generic Eclipse error.

When I click the drop-down arrow on the Run button, only "Run configurations" is available, and on that Run Configurations pane I cannot add a run configuration, the New button is greyed out.


Please can someone give more information on how to debug or fix this kind of error in Eclipse? I get the feeling I've missed some step that might be obvious to people who know Eclipse.

解决方案

I don't use this as a lua compiler - I use it to run embedded lua so when I tried to start a console script I got the same result as you.

Here's what I did - not sure if it's the best way but it works

Click Run/External Tools/External Tools Configurations... A dialog box pops up Put in

Name: lua
Location: /usr/local/bin/lua
Working Directory: ${container_loc}
Arguments: ${resource_name}

Then click on the green run drop down and select Run Configurations then in the dialog add a new configuration by clicking on the Add button on the right and select lua under the program list. Click Apply.

Now when you select main.lua and click on play it runs the lua script you've selected. Then after doing this I thought what happens if I read the manual and sure enough :-). click on help and Help Contents then in the help look at 'LDT user guide' and it tells you what to do there, a lot more elegantly than the above.

Hopefully this will get you started. cheers.

[Update: I tried the following the manual and it works for me. I put a print in, selected main.lua and clicked the green button and it prints hello in the console output below

local function main()
 print "hello"
end
main()

[Update2: no you need the external configuration stuff even after following the manual]

这篇关于首次使用Lua设置Eclipse的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆