Linux下Eclipse在哪里找eclipse.ini

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8419099/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 03:32:21  来源:igfitidea点击:

Where does Eclipse look for eclipse.ini under Linux

linuxeclipseubuntu

提问by Jon Strayer

I've just been setting up a Ubuntu workstation and wanted to add some settings to eclipse.ini. When I searched for the file I found:

我刚刚设置了一个 Ubuntu 工作站,想向 eclipse.ini 添加一些设置。当我搜索文件时,我发现:

  • /etc/eclipse.ini
  • /usr/lib/eclipse.ini
  • /etc/eclipse.ini
  • /usr/lib/eclipse.ini

My questions are:

我的问题是:

  • Does Eclipse actually use both files?
  • If so, in what order does it read them?
  • How does it merge them?
  • Both of the files I found are system wide, is there a location in my home directory I could put one that would effect only my instances?
  • Eclipse 实际上是否同时使用这两个文件?
  • 如果是这样,它以什么顺序读取它们?
  • 它如何合并它们?
  • 我发现的两个文件都是系统范围的,我的主目录中有一个位置可以放置一个只影响我的实例的位置吗?

采纳答案by Jon Strayer

There is only one file.

只有一个文件。

lrwxrwxrwx 1 root root 16 Aug 8 2012 /usr/lib/eclipse/eclipse.ini -> /etc/eclipse.ini

lrwxrwxrwx 1 root root 16 Aug 8 2012 /usr/lib/eclipse/eclipse.ini -> /etc/eclipse.ini

回答by user2069626

You probably have already found this out, chances are when you installed Eclipse the installation created (or you did manually) a file /usr/bin/eclipse which if you check it probably looks like the following:

您可能已经发现了这一点,很有可能当您安装 Eclipse 时,安装会创建(或您手动创建)一个文件 /usr/bin/eclipse,如果您检查它,它可能如下所示:

#!/bin/sh
export ECLIPSE_HOME="/opt/eclipse"

$ECLIPSE_HOME/eclipse $*

especiallyif you followed instructions similar to the ones like theseon If-not-true-then-false

特别是如果你遵循类似的那些说明这样的。如果-不真那么假

On the other hand if you have installed from a package, I suspect you will find that eclipse ends up in /usr/bin, most likely a symbolic link to /usr/lib/eclipse/eclipse (or at least I found it on my Fedora system after using yum to install eclipse).

另一方面,如果您是从包安装的,我怀疑您会发现 eclipse 最终在 /usr/bin 中,很可能是指向 /usr/lib/eclipse/eclipse 的符号链接(或者至少我在我的使用yum安装eclipse后的Fedora系统)。

回答by Alexander Taylor

Here's how to determine which eclipse.ini file you should use (joomla.org):

以下是如何确定您应该使用哪个 eclipse.ini 文件 (joomla.org):

  • If you downloaded Eclipse IDE manually from internet the "eclipse.ini" file is just inside the unpacked folder
  • If you installed Eclipse via terminal or software center the location of the file is "/etc/eclipse.ini"
  • In some Linux versions the file can be found at "/usr/share/eclipse/eclipse.ini". Do notuse this file if you found a config file at "/etc/eclipse.ini".
  • 如果您从 Internet 手动下载 Eclipse IDE,“eclipse.ini”文件就在解压文件夹中
  • 如果您通过终端或软件中心安装 Eclipse,则该文件的位置为“/etc/eclipse.ini”
  • 在某些 Linux 版本中,可以在“/usr/share/eclipse/eclipse.ini”中找到该文件。难道,如果你找到一个配置文件,在“/etc/eclipse.ini”使用此文件。

To be sure where your Eclipse folder is, check $ECLIPSE_HOME, and if not specified (these directions at least work for Juno):

要确定您的 Eclipse 文件夹在哪里,请检查 $ECLIPSE_HOME,如果未指定(这些说明至少适用于 Juno):

  • Open Eclipse as you normally do.
  • Click Help -> About Eclipse SDK
  • Click Installation Details
  • Go to the Configuration tab
  • Find "eclipse.home.location=file:PATH". PATHis where eclipse is installed.
  • 像往常一样打开 Eclipse。
  • 点击帮助 -> 关于 Eclipse SDK
  • 单击安装详细信息
  • 转到配置选项卡
  • 找到“eclipse.home.location=file: PATH”。 PATH是安装 eclipse 的地方。

sources:

来源:

回答by jharig23

According to https://wiki.eclipse.org/Eclipse.ini

根据https://wiki.eclipse.org/Eclipse.ini

Eclipse startup is controlled by the options in $ECLIPSE_HOME/eclipse.ini. If $ECLIPSE_HOME is not defined, the default eclipse.ini in your Eclipse installation directory (or in the case of Mac, the Eclipse.app/Contents/MacOS directory) is used.

Eclipse 启动由 $ECLIPSE_HOME/eclipse.ini 中的选项控制。如果未定义 $ECLIPSE_HOME,则使用 E​​clipse 安装目录(或在 Mac 的情况下,Eclipse.app/Contents/MacOS 目录)中的默认 eclipse.ini。

回答by Vladimir

The certain way to make sure is to run strace on eclipse. In the output you'll see where is eclipse actually trying to pull the file from.

确定的方法是在 eclipse 上运行 strace。在输出中,您将看到 eclipse 实际尝试从中提取文件的位置。

回答by fairtrax

I have Ubuntu 18 and eclipse installation is squashed in a file

我有 Ubuntu 18 并且 eclipse 安装被压缩在一个文件中

/var/lib/snapd/snaps/eclipse_40.snap

/var/lib/snapd/snaps/eclipse_40.snap

which is mount on /snap/eclipse/40 as read only. Just run

它以只读方式安装在 /snap/eclipse/40 上。赶紧跑

mount | grep eclipse*.snap

This eclipse.ini file is really read only, that means, you cannot modify it, even with sudo. However, I also have a eclipse.ini.ignored file in HOME/.eclipse/some number/configuration. This is being by default ignored, but you can change the "launcher.ini" in the eclipse launcher command.

这个 eclipse.ini 文件实际上是只读的,这意味着您不能修改它,即使使用 sudo。但是,我在 HOME/.eclipse/ some number/configuration 中也有一个 eclipse.ini.ignored 文件。这在默认情况下被忽略,但您可以更改 eclipse 启动器命令中的“launcher.ini”。