如何使eclipse指向与exe文件相同的文件夹中的工作空间? [英] How to make eclipse refer to workspace in the same folder as exe file?

查看:241
本文介绍了如何使eclipse指向与exe文件相同的文件夹中的工作空间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使eclipse指向与eclipse.exe文件相同的文件夹中的工作区,而不是每次都问我。我使用eclipse在几台电脑(校园里的不同实验室+我自己的笔记本电脑)上,并且驱动器盘符总是改变,所以有一种方法使日食...更便携?

How to make eclipse refer to workspace in the same folder as eclipse.exe file without asking me every time. I use eclipse on usb stick on several computers (different labs around campus + my own laptop), and drive letter always changes, so is there a way to make eclipse... more portable?

推荐答案

请参阅此回答关于使用特定工作区启动Eclipse

有一个命令行参数 -data 可以给Eclipse提供工作区的位置。您可以创建一个名为runeclipse.bat的批处理文件,并将当前目录作为工作区的位置。我会创建一个名为工作空间的子目录。

There is a command-line argument -data you can give Eclipse for the location of the workspace. You could create a batch file called 'runeclipse.bat' and give it the current directory as the location of the workspace. I would create a subdirectory named 'workspace' though.

eclipse.exe -data .\workspace

更好的主意是编辑与可执行文件在同一目录中的 eclipse.ini ,并将数据参数。确保-data参数在任何JVM参数

A better idea would be to edit the eclipse.ini, which is in the same directory as the executable, and put the -data argument there. Make sure the -data argument appears before any JVM arguments

之前出现例如,这里是我的eclipse.ini文件

For example, here is my eclipse.ini file

-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.1.R36x_v20100810
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Xms40m
-Xmx384m

我会像这样添加-data参数,我留下空行显示添加的内容,因为代码块中没有HTML或Markdown格式,请记住,空行应该不在实际的 eclipse.ini 文件中。

I would add the -data argument like so, I've left empty lines to show what was added since there is no HTML or Markdown formatting in a code block, remember that the blank lines should not be in the actual eclipse.ini file.

-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.1.R36x_v20100810
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile

-data
.\workspace     

-vmargs
-Xms40m
-Xmx384m

这篇关于如何使eclipse指向与exe文件相同的文件夹中的工作空间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆