Launch terminal from eclipse

2020-06-05 06:15发布

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.

1条回答
▲ chillily
2楼-- · 2020-06-05 06:30

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" enter image description here

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

查看更多
登录 后发表回答