使用特定工作区启动 Eclipse

发布于 2024-07-06 15:22:24 字数 130 浏览 5 评论 0原文

有没有办法启动 Eclipse 实例,向其传递某种参数,告诉它使用特定的工作空间?

我试图解决的问题是我有一个用于工作项目的工作空间和一个用于个人项目的工作空间。 我希望能够将它们与工作区绑定到可以独立启动的单独快捷方式。

Is there a way to start an instance of eclipse, passing it some sort of parameter telling it to use a specific workspace?

The problem I'm trying to solve is that I have a workspace for work projects and one for personal projects. I'd like to be able to tie these to workspaces to separate shortcuts that I could launch independently.

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

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

发布评论

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

评论(9

泪是无色的血 2024-07-13 15:22:24

来自 http://help.eclipse。 org/help21/topic/org.eclipse.platform.doc.user/tasks/running_eclipse.htm

使用以下命令行参数:

-data your_workspace_location

例如,

-data c:\users\robert\myworkspace

您还可以使用 UNIX 风格的相对路径名,例如

-data ../workspace

甚至在 Windows 下,以防参数中不喜欢冒号或反斜杠,例如 Jumplist Launcher

From http://help.eclipse.org/help21/topic/org.eclipse.platform.doc.user/tasks/running_eclipse.htm:

Use the following command-line argument:

-data your_workspace_location

For example,

-data c:\users\robert\myworkspace

you can also use UNIX-style relative path names such as

-data ../workspace

even under Windows, in case something doesnt like colons or backslashes in parameters, like Jumplist Launcher

陪你到最终 2024-07-13 15:22:24

使用 -data 开关

使用 -data 设置工作区的特定位置

要使用 -data 命令行参数,只需将 -data your_workspace_location(例如 -data c:\users\robert\myworkspace)添加到快捷方式属性,或将其显式包含在命令行中。

来自: http: //help.eclipse.org/help21/index.jsp?topic=/org.eclipse.platform.doc.user/tasks/running_eclipse.htm

With the -data switch

Setting a specific location for the workspace with -data

To use the -data command line argument, simply add -data your_workspace_location (for example, -data c:\users\robert\myworkspace) to the Target field in the shortcut properties, or include it explicitly on your command line.

From: http://help.eclipse.org/help21/index.jsp?topic=/org.eclipse.platform.doc.user/tasks/running_eclipse.htm

城歌 2024-07-13 15:22:24

我们通过修改快捷方式属性为高中学生设置默认工作区。 本例中,我们运行的是Windows 7环境。 默认工作区位于映射为 H: 驱动器的学生网络共享上,因此我们添加了-data h:\workspace。 屏幕截图显示了具体位置。

在此处输入图像描述

We set the default workspace for students at a high school by modifying the shortcut properties. In this case, we operate a Windows 7 environment. The default workspace is on a student's network share mapped as the H: drive so we added -data h:\workspace. The screenshot shows exactly where.

enter image description here

你好,陌生人 2024-07-13 15:22:24

请注意,您可以使用 UNIX 风格的相对路径名,甚至

-data ../workspace

在 Windows 下,以防参数中不喜欢冒号或反斜杠,例如 Jumplist Launcher

note that you can use UNIX-style relative path names such as

-data ../workspace

even under Windows, in case something doesn't like colons or backslashes in parameters, like Jumplist Launcher

望她远 2024-07-13 15:22:24

老问题,我知道,但只是想指出您可能需要在目标工作空间路径周围添加引号。 例如; 我尝试了 C:\Eclipse\eclipse.exe -data E:\Eclipse Projects2 ,它会在执行 C:\Eclipse\eclipse.exe -data " 时打开一个空白的默认工作区E:\Eclipse Projects2" 允许它使用现有的工作空间。 我猜这会根据操作系统和/或 Eclipse 版本而有所不同,但我不确定具体是什么因素,所以请尝试两种方法,直到找到一种方法来加载正确/现有的工作区。

Old question, I know, but just wanted to point out that you may need to add quotes around the target workspace path. For example; I tried C:\Eclipse\eclipse.exe -data E:\Eclipse Projects2 and it would open a blank, default, workspace while doing C:\Eclipse\eclipse.exe -data "E:\Eclipse Projects2" allowed it to use the existing workspace. I'm guessing this varies based on OS and/or Eclipse version, but I'm not sure exactly what factors into this, so just try both ways until you get one to load the correct/existing workspace.

故事↓在人 2024-07-13 15:22:24

使用目标创建快捷方式文件:

创建 Eclipse 的快捷方式。
打开快捷方式文件的属性并设置目标,如下所示,

E\STS.exe -data "WORKSPACE_LOCATION"

从 .bat 文件启动:

cd ECLIPSE_LOCATION   
start STS.exe -data "WORKSPACE_LOCATION"

示例:

cd /D D:\IDE\sts-bundle\sts-3.7.0.RELEASE    
start STS.exe -data "D:\My Workspace\workspace1"

Creating a shortcut file with target :

Create a shortcut of your eclipse.
Open the properties of the shortcut file and set the target as follows,

E\STS.exe -data "WORKSPACE_LOCATION"

For launching from .bat file :

cd ECLIPSE_LOCATION   
start STS.exe -data "WORKSPACE_LOCATION"

Example:

cd /D D:\IDE\sts-bundle\sts-3.7.0.RELEASE    
start STS.exe -data "D:\My Workspace\workspace1"
柳若烟 2024-07-13 15:22:24

我希望人们能给出一个实际的例子,我通过例子而不是语法学得更好。
所以就这样...

"C:\MyEclipse Blue Edition\MyEclipse Blue Edition 10\myeclipse-blue.exe" -showlocation -data "C:\EclipseWork\WorkSpace"

这个命令将使用指定的工作空间打开 eclipse。 这是一个工作示例。

I wish people would give an actual example, i learn better with examples rather than syntax.
so here it goes...

"C:\MyEclipse Blue Edition\MyEclipse Blue Edition 10\myeclipse-blue.exe" -showlocation -data "C:\EclipseWork\WorkSpace"

this command will open eclipse with the specified workspace. this is a working example.

几味少女 2024-07-13 15:22:24

来自 https://help .eclipse.org/topic/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html

也可以使用 osgi.instance.area< 指定工作空间位置/code> JVM arg as -Dosgi.instance.area=../workspace

这可以在 eclipse.ini 文件中与现有/其他 JVM 参数(例如 -Xms、-Xmx)一起指定。

对于那些只想附加到 eclipse.ini 文件(已包含其他 JVM 参数)而不必担心确保 JVM 参数出现在末尾的人来说,此选项可能很方便。

From https://help.eclipse.org/topic/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html

It is also possible to specify the workspace location using the osgi.instance.area JVM arg as -Dosgi.instance.area=../workspace

This can be specified in the eclipse.ini file along with existing/other JVM args such as -Xms, -Xmx.

This option may be convenient for those who just want to append to the eclipse.ini file (which already contains other JVM args) without worrying to ensure that JVM args appear at the end.

尛丟丟 2024-07-13 15:22:24

此外,从桌面快捷方式中,通过将 -data“工作区目录路径”添加到目标末尾,将在 Eclipse 特定工作区中打开您的项目。

Additionally, from a desktop shortcut, by adding -data "workspace directory path" to the end of your target will open your project in a eclipse specific workspace.

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