简体   繁体   English

从eclipse启动终端

[英]Launch terminal from eclipse

I recently switched to Eclipse (Helios) for my programming needs, and I like it very much. 我最近切换到Eclipse(Helios)以满足我的编程需求,我非常喜欢它。

There is just on thing that is driving me crazy, how can I launch (compile and run) my code into the native mac osx terminal. 只有让我疯狂的事情,我如何启动(编译和运行)我的代码到本机mac osx终端。

I tried creating an "external tools configuration", but that just starts the terminal without outputting the application. 我尝试创建“外部工具配置”,但这只是启动终端而不输出应用程序。

What I do now is right-click on the binary in the Project Explorer and then "Open With" and then "Other" and then I pick the terminal app from the list. 我现在做的是右键单击Project Explorer中的二进制文件,然后单击“打开方式”,然后单击“其他”,然后从列表中选择终端应用程序。 But this solution is driving me nuts. 但这个解决方案让我疯了。

Please help. 请帮忙。

It's all about defining the External Tool correctly. 这都是关于正确定义外部工具的

For example, the following should work if your selected file is a Unix executable. 例如,如果所选文件是Unix可执行文件,则以下内容应该有效。

  1. Open a new External Tool configuration. 打开新的外部工具配置。
  2. Set the location to /usr/bin/open 将位置设置为/usr/bin/open
  3. Set Working directory as ${selected_resource_loc} 将工作目录设置为${selected_resource_loc}
  4. Set the arguments to -a /Applications/Utilities/Terminal.app ${selected_resource_loc} 将参数设置为-a /Applications/Utilities/Terminal.app ${selected_resource_loc}

When you run make sure you select "src" 当你运行时确保你选择“src” 在此输入图像描述

This should work. 这应该工作。 You could improve it further. 你可以进一步改进它。 You could even write an AppleScript that would do that and run it using osascript . 您甚至可以编写AppleScript来执行此操作并使用osascript运行它。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM