Eclipse 错误“UseStringDeduplication”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/38574448/
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
Eclipse error 'UseStringDeduplication'
提问by Mike S
I installed a fresh Ubuntu 16.04 VM, Oracle JDK 7, and downloaded the latest Eclipse. But I am getting this error when I try to start Eclipse:
我安装了一个全新的 Ubuntu 16.04 VM、Oracle JDK 7,并下载了最新的 Eclipse。但是当我尝试启动 Eclipse 时出现此错误:
Unrecognized VM option 'UseStringDeduplication'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
Why am I getting this error on a fresh install? And is it a bad idea to remove that VM option?
为什么我在全新安装时收到此错误?删除那个 VM 选项是一个坏主意吗?
回答by Mike S
Latest version of Eclipse (Neon) requires Java 8 runtime, and the Eclipse website obnoxiously neglects to mention it anywhere from the homepage to the download link for Eclipse, not even a version warning at runtime for Eclipse.
最新版本的 Eclipse (Neon) 需要 Java 8 运行时,而 Eclipse 网站令人讨厌地忽略了从主页到 Eclipse 下载链接的任何地方,甚至没有在运行时为 Eclipse 提供版本警告。
回答by jonathan
Same error for me in Kubuntu 14.04, eclipse Neon, I Removed -XX:+UseStringDeduplication from .ini file, it works for me
我在 Kubuntu 14.04 中遇到了同样的错误,eclipse Neon,我从 .ini 文件中删除了 -XX:+UseStringDeduplication,它对我有用
回答by Boris N.
I know, i'm little to late to the party. I got this issue lately on my Mac. I updated my eclipse (from Mars to Oxygen) all of the sudden i couldn't start my old project. First i thought, this must have something to do with the new eclipse, which wasn't all wrong. Because eclipse.ini file of Oxygen expected java-1.8.
我知道,我参加聚会有点晚了。我最近在我的 Mac 上遇到了这个问题。我突然更新了我的日食(从火星到氧气),我无法开始我的旧项目。首先我想,这一定与新的日食有关,这并非全错。因为 Oxygen 的 eclipse.ini 文件需要 java-1.8。
I updated my java to latest (jdk1.8.0_152.jdk), but the problem remained, than i removed these parameters from the eclipse.ini, still was the same, i checked the "Run Configurations" and basically removed the same parameters from the arguments list. Now my projects seem to work just fine. I also needed to restore the platform, since Oxygen use e.4-platform.
我将我的java更新到最新的(jdk1.8.0_152.jdk),但问题仍然存在,比我从eclipse.ini中删除了这些参数,仍然是一样的,我检查了“运行配置”并基本上从参数列表。现在我的项目似乎工作得很好。我还需要恢复平台,因为 Oxygen 使用 e.4-platform。
- Remove these parameters from eclipse.ini file
- Select the project and go to "Run As"->"Run Configurations..."-> "Arguments" check the old configurations under "VM arguments" (it can be a product in case of an RCP-project)
- removed the VM-option(s)(actually, they can be more) not recognized and "Apply"-> "Run".
- 从 eclipse.ini 文件中删除这些参数
- 选择项目并转到“运行方式”->“运行配置...”->“参数”检查“VM参数”下的旧配置(它可以是RCP项目的产品)
- 删除了无法识别的 VM 选项(实际上,它们可以更多)和“应用”->“运行”。
回答by Menuka Ishan
I got the same error when I have installed Java 8 and Java 9 in my Ubuntu 16.04. My eclipse version was Neon. As https://wiki.eclipse.org/Eclipse/Installation#Eclipse_4.6_.28Neon.29describes to start specific eclipse ide you need relevant JDK. For neon, it was Java 8. Since I installed Java 9 using apt-get it was the default JDK. so I have to change the default JDK to Java 8.
在 Ubuntu 16.04 中安装 Java 8 和 Java 9 时,我遇到了同样的错误。我的eclipse版本是Neon。正如https://wiki.eclipse.org/Eclipse/Installation#Eclipse_4.6_.28Neon.29所描述的,要启动特定的 eclipse ide,您需要相关的 JDK。对于neon,它是Java 8。因为我使用apt-get 安装了Java 9,所以它是默认的JDK。所以我必须将默认的 JDK 更改为 Java 8。
You can check which java version used in system-wide with
您可以使用以下命令检查系统范围内使用的 Java 版本
java -version
`If you want to see which are the versions of JDK installed in Ubuntu then run below command in shell.
`如果您想查看 Ubuntu 中安装的 JDK 版本,请在 shell 中运行以下命令。
sudo update-java-alternatives --list
Then choose which version you want to set. After that run below command.
然后选择要设置的版本。之后运行下面的命令。
sudo update-java-alternatives --set [JDK/JRE name e.g. java-8-oracle]
Now run again Eclipse. if the version was the reason to conflict, it will run now. Referred by http://menukanows.com/how-to-set-a-default-jdk-version-in-ubuntu/
现在再次运行 Eclipse。如果版本是冲突的原因,它将立即运行。引用自http://menukanows.com/how-to-set-a-default-jdk-version-in-ubuntu/
回答by Parvesh Jain
String Deduplication – A new feature in Java 8 Update 20
字符串重复数据删除——Java 8 Update 20 中的一个新特性
It means you should nt java 1.8 updated later or equal 20.
这意味着您不应该将 Java 1.8 更新为以后或等于 20。
回答by Chandrani H
I faced the same issue on Eclipse Oxygenin Ubuntu.
我在 Ubuntu 的Eclipse Oxygen上遇到了同样的问题。
Tried:
尝试过:
- Checking java version (It was already at 1.8.0 so according to the accepted answer, it should work.)
- Removing -XX:+UseStringDeduplication from .ini file
- 检查 java 版本(它已经是 1.8.0,所以根据接受的答案,它应该可以工作。)
- 从 .ini 文件中删除 -XX:+UseStringDeduplication
Still didn't solve the problem. Then I saw @simgineer's comment:
还是没有解决问题。然后我看到@simgineer 的评论:
In my case this was for eclipse oxygen. I had an older version of java 8 installed (jdk1.8.0_05) when I upgraded to the latest (jdk1.8.0_151) and updated my eclipse.ini to point to the latest as well (since it is recorded in there during installation) eclipse oxygen started working.
就我而言,这是用于日食氧气。当我升级到最新版本(jdk1.8.0_151)并更新我的 eclipse.ini 以指向最新版本时,我安装了旧版本的 java 8(jdk1.8.0_05)(因为它在安装过程中记录在那里)日食氧气开始工作。
Solution:
解决方案:
Updated JDK from 1.8.0 to jdk1.8.0_231 and it got resolved. Voila! I didn't have to update anything in my eclipse.ini .
将 JDK 从 1.8.0 更新到 jdk1.8.0_231 并得到解决。瞧!我不必更新 eclipse.ini 中的任何内容。