是否可以向 eclipse.ini 文件添加注释

发布于 2024-11-09 20:14:31 字数 249 浏览 2 评论 0原文

我想评论我现在使用的一些自定义参数,以便下次编辑它们时记住它们为什么在那里。

但我在该文件中找不到任何对注释的引用。只有这个,但它很漂亮旧的,希望现在有一种方法可以添加评论。

有人知道吗?

I wanted to comment some custom parameters I am using now, to remember why they are there the next time I edit it.

But I cannot find any reference to comments in this file. Only this, but it is pretty old and hopefully there is a way to add comments now.

Somebody knows?

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

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

发布评论

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

评论(5

爱情眠于流年 2024-11-16 20:14:31

注释可以用分号 (;) 或哈希 (#) 标记(至少在 Windows 上)

Comments can be marked with semicolon (;) or hash (#) (at least on Windows)

森罗 2024-11-16 20:14:31

Windows 7 上的 Eclipse 4.5.2,# 对我有用。
但要小心,键值在 eclipse.ini 中位于单独的行中,您需要同时注释掉键值。我添加了一个例子。

工作

#-clean
-startup
plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar
-showlocation
#-vm
#C:/dev/software/jdk1.8.0_121/bin/javaw.exe
-vm
C:/dev/software/jdk1.8.0_131/bin/javaw.exe

不工作

-vm
#C:/dev/software/jdk1.8.0_121/bin/javaw.exe
C:/dev/software/jdk1.8.0_131/bin/javaw.exe

Eclipse 4.5.2 on Windows 7, # is working for me.
but be careful, key - value are in separate line in eclipse.ini and you need to comment out key-value in same time. I added a example.

Working

#-clean
-startup
plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar
-showlocation
#-vm
#C:/dev/software/jdk1.8.0_121/bin/javaw.exe
-vm
C:/dev/software/jdk1.8.0_131/bin/javaw.exe

Not working

-vm
#C:/dev/software/jdk1.8.0_121/bin/javaw.exe
C:/dev/software/jdk1.8.0_131/bin/javaw.exe
谜兔 2024-11-16 20:14:31

eclipse.ini 中的这些注释有一点精确,至少对于 Windows (7) 来说是如此。
奇怪的是,使用前导“#”可能会导致插件管理出现问题

下面是一个卸载示例:

An error occurred while uninstalling
session context was:(profile=epp.package.java, phase=org.eclipse.equinox.internal.p2.engine.phases.Uninstall, operand=[R]com.test.myeclipseplugins 1.2.3 --> [R]com.test.myeclipseplugins 1.2.4, action=org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.UninstallBundleAction).
java.net.URISyntaxException: Illegal character in scheme name at index 0: %23C:/Program%20Files/Java/jdk1.8.0_92/bin/javaw.exe
java.net.URISyntaxException: Illegal character in scheme name at index 0: %23C:/Program%20Files/Java/jdk1.8.0_92/bin/javaw.exe

不幸的是,这个“%23”字符是您的前导“#”。
避免这个问题的唯一方法似乎就是避免使用注释:(

在这种情况下我真正做的是,这个“#”不会阻止 Eclipse 启动< /strong> (这是其他“坏”字符的情况,例如“;”或“//”),但是 then 使其他功能因不那么明显的堆栈跟踪而崩溃(卸载插件时)面对前一个堆栈,你首先会想到一个问题eclipse.ini?)

A little precision on those comments in eclipse.ini, at least for Windows (7).
Strangely, using a leading "#" can result in issues with plugins management.

Here is an example with the uninstallation of one:

An error occurred while uninstalling
session context was:(profile=epp.package.java, phase=org.eclipse.equinox.internal.p2.engine.phases.Uninstall, operand=[R]com.test.myeclipseplugins 1.2.3 --> [R]com.test.myeclipseplugins 1.2.4, action=org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.UninstallBundleAction).
java.net.URISyntaxException: Illegal character in scheme name at index 0: %23C:/Program%20Files/Java/jdk1.8.0_92/bin/javaw.exe
java.net.URISyntaxException: Illegal character in scheme name at index 0: %23C:/Program%20Files/Java/jdk1.8.0_92/bin/javaw.exe

This "%23" character unfortunately is your leading "#".
And the only way to avoid the issue seems to just avoid using comments :(

What I do really not like in this case, is that this "#" doesn't prevent Eclipse from launching (which is the case for other "bad" characters such as ";" or "//"), but then makes other features crash with that not so evident stacktrace (when uninstalling a plugin and facing the former stack, would you first think to an issue in eclipse.ini?)

爱你是孤单的心事 2024-11-16 20:14:31

托马斯,我不相信你对所遇到问题的分析,因为你没有显示可能导致该问题的 eclipse.ini 文件。

我也有 Windows 7,但 eclipse.ini 中的“#”没有问题。如果您查看 EquinoxFwConfigFileParser 类的源代码,您会发现它使用 Java Properties.load(FileInputStream) 方法读取 *.ini 文件。因此,由于“#”在 Java 属性文件中充当注释信号,因此它在 eclipse.ini 中也充当注释信号。

但让我们只看一下现象。 *.ini 文件出现在 Eclipse 安装中的许多地方,例如安装目录的配置子目录中的 config.ini 文件。它是这样开始的:

#This configuration file was written by: org.eclipse.equinox.internal.frameworkadmin.equinox.EquinoxFwConfigFileParser
#Fri Feb 10 15:57:47 CET 2017
org.eclipse.update.reconcile=false
...

“#”似乎不太可能在那里用作注释信号,但在具有相同结构的 eclipse.ini 中则不然。 (我们现在知道它只是 Java 属性文件的结构。)

您的错误消息

... in scheme name at index 0: %23C:/Program%20Files/Java/jdk1.8.0_92/bin/javaw.exe

可能来自某些具有如下两行的 ini,它们可能出现在 eclipse.ini 中:

-vm
#C:/Program Files/Java/jdk1.8.0_92/bin/javaw.exe

"#" is a legal character in Windows 文件/目录名称。 “-vm”后面的行应该是文件名,或者更确切地说是 URI。如果未找到指定的 javaw.exe,Eclipse 启动器将采用在 PATH 环境变量中找到的一个。

例如,这

-vm
#Hello
#K:/studevaux/dev_javaver64/jdk8/bin/javaw.exe
-vmargs

可以很好地启动 eclipse - 但正如我意识到的那样,只是因为我的系统路径中有一个 javaw.exe 。当我消除它时,我收到一条错误消息:

错误消息:找不到启动 eclipse 的 java.exe

Thomas, I'm not convinced by your analysis of the problem you experienced, because you don't show the eclipse.ini file that supposedly caused it.

I too have Windows 7 but no problem with "#" in eclipse.ini. If you look at the source of the EquinoxFwConfigFileParser class, you will find it reads an *.ini file with the Java Properties.load(FileInputStream) method. So since "#" works as a comment signal in a Java properties file, it works as one also in eclipse.ini.

But let's look just at the phenomena. *.ini files occur in many places in an eclipse installation, for example the config.ini file in the configuration subdirectory of the installation directory. It starts like this:

#This configuration file was written by: org.eclipse.equinox.internal.frameworkadmin.equinox.EquinoxFwConfigFileParser
#Fri Feb 10 15:57:47 CET 2017
org.eclipse.update.reconcile=false
...

It seems unlikely that "#" would work as a comment signal there, but not in eclipse.ini which has the same kind of structure. (We know now that it is just the structure of a Java Properties file.)

Your error message

... in scheme name at index 0: %23C:/Program%20Files/Java/jdk1.8.0_92/bin/javaw.exe

might come from some ini with two lines such as the following, that can appear in an eclipse.ini:

-vm
#C:/Program Files/Java/jdk1.8.0_92/bin/javaw.exe

"#" is a legal character in Windows file/directory names. The line following "-vm" is expected to be a file name, or rather a URI. If the specified javaw.exe is not found, the eclipse launcher will take one it finds in the PATH environment variable.

This for example

-vm
#Hello
#K:/studevaux/dev_javaver64/jdk8/bin/javaw.exe
-vmargs

worked fine to start eclipse - but only, as I realized, because I have a javaw.exe in my system PATH. When I eliminated that, I got an error message:

Error message: no java.exe found to start eclipse

潦草背影 2024-11-16 20:14:31

在 Ubuntu 和 Linux Mint(基于 Debian 的操作系统)中,您可以使用 # 添加注释

; 在 Ubuntu / Linux Mint 中不起作用。< /强>

In Ubuntu and Linux Mint (Debian based OS) you can add comments with #

; not working in Ubuntu / Linux Mint.

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