简体   繁体   中英

Launch terminal from eclipse

I recently switched to Eclipse (Helios) for my programming needs, and I like it very much.

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.

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. 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.

  1. Open a new External Tool configuration.
  2. Set the location to /usr/bin/open
  3. Set Working directory as ${selected_resource_loc}
  4. Set the arguments to -a /Applications/Utilities/Terminal.app ${selected_resource_loc}

When you run make sure you select "src" 在此输入图像描述

This should work. You could improve it further. You could even write an AppleScript that would do that and run it using osascript .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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