简体   繁体   English

当我从 Eclipse 运行我的 MonkeyC 程序时,为什么我的代码更改没有编译或显示?

[英]Why do my code changes not compile or show up when I run my MonkeyC program from Eclipse?

I am using Eclipse, the ConnectIQ add-on, and MonkeyC to write an app for a Garmin watch.我正在使用 Eclipse、ConnectIQ 附加组件和 MonkeyC 为 Garmin 手表编写应用程序。 I can run several sample apps on the simulator, but most of the time my edits don't deploy when I hit "Run".我可以在模拟器上运行多个示例应用程序,但大多数情况下,当我点击“运行”时,我的编辑不会部署。

IDE info: Eclipse IDE for Java Developers Version: 2018-12 (4.10.0) Build id: 20181214-0600 IDE 信息:面向 Java 开发人员的 Eclipse IDE 版本:2018-12 (4.10.0) 构建 ID:20181214-0600

In the Garmin SDK's ActivityTrackerApp, the default UI is laid out in the file ActivityTrackerApp.mc.在 Garmin SDK 的 ActivityTrackerApp 中,默认 UI 布局在文件 ActivityTrackerApp.mc 中。 The lines I'm editing are:我正在编辑的行是:

var stepsPercent = info.steps.toFloat() / info.stepGoal; var stepsPercent = info.steps.toFloat() / info.stepGoal; drawBar(dc, "Steps", dc.getHeight() / 4, stepsPercent, Graphics.COLOR_GREEN); drawBar(dc, "Steps", dc.getHeight() / 4, stepsPercent, Graphics.COLOR_GREEN);

I'm editing the string "Steps" from these two lines and then I hit "Run".我正在编辑这两行中的字符串“Steps”,然后点击“Run”。

I would expect to see the label "Steps" in the simulator changed to whatever new string I input, but the label appears unchanged.我希望看到模拟器中的标签“Steps”更改为我输入的任何新字符串,但标签看起来没有变化。 I tried restarting the simulator as well as killing the app within the simulator.我尝试重新启动模拟器以及杀死模拟器中的应用程序。 I also tried cleaning and rebuilding the project several times with no change.我还多次尝试清理和重建项目,没有任何变化。 I don't see any compiler errors, nor do I expect any.我没有看到任何编译器错误,也不希望有任何错误。 What does it take to get valid code changes to compile and deploy?获得有效的代码更改以编译和部署需要什么?

I found that I simply needed to save my changed files for the changes to be compiled.我发现我只需要保存更改的文件即可编译更改。 My confusion was based on Visual Studio in which this is done automatically.我的困惑是基于 Visual Studio,它是自动完成的。 Not so in Eclipse, at least by default.在 Eclipse 中并非如此,至少在默认情况下是这样。 Note that there is a setting to save automatically before build, though even after checking that setting I still have to manually hit save.请注意,有一个设置可以在构建之前自动保存,但即使在检查该设置之后我仍然必须手动点击保存。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Eclipse中运行时,不会显示对我的代码的编辑 - Edits to my code do not show up when running in Eclipse 为什么在Eclipse上运行代码时为什么保留异常消息? - Why do I keep an exception message when ever I run my code on Eclipse? 如何从php Eclipse工作区运行代码 - How do I run my code from php eclipse workspace 为什么我必须在Eclipse中“全部构建”才能运行C ++程序? - Why do I have to “Build-All” in Eclipse for my C++ program to run? 在Eclipse和Maven中进行清理后,为什么还能运行程序? - Why can I run my program after cleaning in Eclipse and Maven? 为什么我添加到“工作区”文件夹中的项目不显示? [日食] - Why do projects that I add to my 'workspace' folder don't show up? [ECLIPSE] 运行项目时,未反映对Eclipse中的类所做的更改 - Changes to my classes in Eclipse are not reflected when I run the project 当我尝试运行我的应用程序时,为什么 Eclipse 会显示多个应用程序配置? - Why does Eclipse show multiple application configurations when I try to run my application? 为什么我的 Java 代码更改在从命令行运行但在 Eclipse 中运行时没有反映出来? - Why are my Java code changes not being reflected when ran from command line but working in Eclipse? 如何阻止 Eclipse 的格式弄乱我的代码? - How do I stop Eclipse's format from messing up my code?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM