Eclipse 集成开发环境;在当前窗口/实例中打开?

发布于 2024-08-18 07:42:27 字数 329 浏览 1 评论 0 原文

我已经使用 Eclipse 大约一周了,我很喜欢它..对于“价格”来说是很棒的软件。 :P 但是,我在开始时遇到了一些问题。

到目前为止,最烦人的是从 Eclipse 外部打开文件,并将它们设置为使用 Eclipse 打开。当我从文件资源管理器或外部应用程序(例如 WinSCP)打开文件时,Eclipse 似乎尝试打开一个全新的实例本身,而不是在当前运行的实例中打开该文件。当然,因为是这种情况,Eclipse 会出错并显示“工作空间当前正在使用中”。请选择另一个'(或它所说的任何内容)。

在外部打开文件时是否可以使用配置选项或参数,仅使用当前打开的 Eclipse 实例?

提前谢谢! :)

I've been using Eclipse for about a week now and I'm loving it.. great software for the 'price'. :P However, I'm having a few issues getting started.

The most annoying, so far, has been opening files from outside of Eclipse, and having them set to open w/ Eclipse. When I open a file from the file-explorer or an external application (WinSCP for instance), Eclipse seemingly attempts to open an entirely new instance itself rather than opening the file within a currently running instance. Of course, because this is the case, Eclipse errors out w/ 'The workspace is currently in use. Please select another' (or whatever it says).

Is there a configuration option, or an argument that I can use when opening a file externally that will simply use the currently open instance of Eclipse?

Thx in advance! :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

香橙ぽ 2024-08-25 07:42:27

在当前 Eclipse 中打开外部文件的最简单方法是将其拖放到显示文件的选项卡区域。您应该考虑到 Eclipse 非常适合将文件用作项目的一部分,并且使用 Eclipse 打开随机文件当然是可能的,但不鼓励这样做。
对于你的问题 - 由于 Eclipse 在 Java 中运行,如果你尝试使用 eclipse.exe 打开文件,那么脚本将始终尝试打开一个新实例,我不知道你想要的是否实际上可行

The easiest way to open external file in the current Eclipse is to drag-n-drop it to the tabbed area where your files are displayed. You should consider that Eclipse is seriously geared towards using files as part of a project and opening random file with Eclipse is certainly possible but not encouraged.
To your question - since Eclipse runs in Java if you attempt to use eclipse.exe to open a file then script will always try to open a new instance, I don't know if what you want is actually doable

山川志 2024-08-25 07:42:27

添加到 DroidIn.net答案,以下是与该问题相关的一些 eclipse bug:

  • bug 4922(从 2001 年开始!):“需要能够从命令行在 Eclipse 中打开文件”, sockent 监控类型的解决方案,例如 IBM 的 打开一个来自 URL 的 RCP,这会导致诸如 EclipseCalls

    <块引用>

    EclipseCall 是一个在定义的套接字端口上接受文件打开请求的插件。 专用客户端可用于通过来自 Eclipse 外部的命令在 Eclipse 中打开文件,例如通过双击 Windows 资源管理器中的源文件

  • bug 178927 (2007):“传递参数的方式从启动器到正在运行的应用程序实例”,基于修改器启动器(更面向 Windows,尽管 bug 201154 是面向 mac 的)。还研究了基于 OSGi 的解决方案 .

(在 Linux 上,请参阅 还有 steb )

To add to DroidIn.net's answer, here are a few eclipse bugs related to the question:

  • bug 4922 (from 2001!): "Need ability to open a file in eclipse from the command line", with sockent-monitoring kind of solutions, like the IBM proposition of opening an RCP from an URL, which leads to plugins like EclipseCalls.

    EclipseCall is a plugin that accepts file-open requests on a defined socket port. A specialized client can be used to open a file in Eclipse by command from outside Eclipse, e.g. by double clicking a source file in Windows Explorer.

  • bug 178927 (2007): "way to pass arguments from launcher to a running application instance", based on a modifier launcher (more Windows-oriented, although bug 201154 is mac-oriented). An OSGi-based solution is also investigated.

(On Linux, see also steb)

滿滿的愛 2024-08-25 07:42:27

在 Mac 终端中,您可以使用 open,但我需要明确指向可执行文件,因为我安装了多个 Eclipse:

open -a ~/eclipse/java-oxygen/Eclipse.app  --args --launcher.openFile filename

您可能需要也可能不需要 --launcher.openFile ,具体取决于您是否在 eclipse.ini 中将 --launcher.defaultAction 设置为 openFile 文件。 (此配置文件编辑也是您双击或“打开方式”以使用正在运行的 Eclipse 所需的内容。)

例如,我可以执行此操作(使用 gnu parallel) 在复制到剪贴板后打开所有失败的测试(pbpaste 是特定于 Mac 的) :

pbpaste | parallel find . -name {}\\\* -print \
   | parallel open -a ~/eclipse/java-oxygen/Eclipse.app

适用于所有操作系统的 Eclipse 文件打开文档位于此处

In a Mac terminal, you can use open, though I needed to point to the executable explicitly, since I have more than one Eclipse installed:

open -a ~/eclipse/java-oxygen/Eclipse.app  --args --launcher.openFile filename

You may or may not need --launcher.openFile, depending if you have --launcher.defaultAction set to openFile in your eclipse.ini file. (This config-file edit is also what you need for double-clicking or "open-with" to use the running Eclipse.)

For instance, I could do this (with gnu parallel) to open all of my failing tests after I'd copied to the clipboard (pbpaste is mac-specific):

pbpaste | parallel find . -name {}\\\* -print \
   | parallel open -a ~/eclipse/java-oxygen/Eclipse.app

The Eclipse file-opening documentation for all OSes is here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文