简体   繁体   English

如何修复Eclipse Java虚拟机启动程序错误?

[英]How to fix Eclipse Java Virtual Machine Launcher Error?

So like the title says, Im having an issue with eclipse JVM launcher. 就像标题所说的那样,我遇到了eclipse JVM启动器的问题。 Last night, everything was working fine, as far as I know, nothing at all has changed on my pc since then. 昨晚,一切都运转良好,据我所知,从那时起我的电脑上什么都没有改变。 However, I woke up this morning to find that when I run any of my projects in eclipse I recive this error: Java Virtual Machine Launcher- Error: could not open C:\\Program Files\\Java\\jre1.8.0_60\\lib\\amd6jvm.cfg 但是,我今天早上醒来发现当我在eclipse中运行我的任何项目时,我发现了这个错误: Java Virtual Machine Launcher- Error: could not open C:\\Program Files\\Java\\jre1.8.0_60\\lib\\amd6jvm.cfg

I have already verified the integrity of my Path variable, ( C:\\Program Files\\Java\\jdk1.8.0_65\\bin ) Now at this point, you may notice, my jdk is on version 65. So is my JRE and java installation. 我已经验证了Path变量的完整性,( C:\\Program Files\\Java\\jdk1.8.0_65\\bin )现在,您可能会注意到,我的jdk是65版本。我的JRE和Java安装也是如此。 I dont understand why eclipse is using jre 60. I also checked the preferences and changed the jre version too 65. No luck. 我不明白为什么eclipse使用jre 60.我也检查了偏好并且改变了jre版本65.没有运气。 Furthermore, I ran a simple java file without using eclipse through the command line and that ran/compiled just fine. 此外,我运行了一个简单的java文件,没有通过命令行使用eclipse,运行/编译就好了。 I tried adding the -vm tag (It didn't already exist there) to eclipse.ini and setting it too the jvm but it didn't help. 我尝试将-vm标签(它尚未存在)添加到eclipse.ini并将其设置为jvm,但它没有帮助。 (I than removed it) I have no idea what to do... Please help, I've tried everything I know how to do. (我除了它)我不知道该怎么做...请帮助,我已经尝试了我知道如何做的一切。 Thanks! 谢谢!

EDIT: 编辑:

My eclipse.ini file below: 我的eclipse.ini文件如下:

-startup
../../../.p2/pool/plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar
--launcher.library
../../../.p2/pool/plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.300.v20150602-1417
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-install
C:/Users/Sanjiv/eclipse/java-mars/eclipse
-vmargs
-Dosgi.requiredJavaVersion=1.7
-Xms256m
-Xmx1024m
-Doomph.update.url=http://download.eclipse.org/oomph/updates/milestone/latest
-Doomph.redirection.index.redirection=index:/->http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/

EDIT 2 I have already tried reinstalling java, eclipse and jdk. 编辑2我已经尝试重新安装java,eclipse和jdk。

For windows user, if your getting this error: 对于Windows用户,如果您收到此错误:

Java Virtual Machine Launcher- Error: could not open C:\\Program Files\\Java\\jre1.8.0_60\\lib\\amd6jvm.cfg Java虚拟机启动器 - 错误:无法打开C:\\ Program Files \\ Java \\ jre1.8.0_60 \\ lib \\ amd6jvm.cfg

it indicates there is no jre1.8.0_60 version in your system. 它表示您的系统中没有jre1.8.0_60版本。 So you need to set the JRE version which is already there in our system by executing the below command: 因此,您需要通过执行以下命令来设置我们系统中已存在的JRE版本:

  1. Go to cmd prompt 转到cmd提示符
  2. go to the eclipse folder (which you have installed) by executing: cd eclipse-folder-path 通过执行以下命令转到eclipse文件夹(已安装):cd eclipse-folder-path
  3. execute below command: eclipse -vm jre_path 执行以下命令: eclipse -vm jre_path
    ex: 例如:

     eclipse -vm "C:\\Program Files\\Java\\jdk1.8.0_131\\jre\\bin\\javaw" 

Ok, so after a bit of digging, I managed to fix the problem. 好的,经过一番挖掘后,我设法解决了这个问题。 In eclipse, I went to Windows>Preferences>Java>Installed JREs>Execution Enviorments>JavaSE-1.8>Compatible JREs>jre1.8.0_65(perfect match) . 在eclipse中,我进入了Windows>Preferences>Java>Installed JREs>Execution Enviorments>JavaSE-1.8>Compatible JREs>jre1.8.0_65(perfect match) I have no idea why or how that changed, (or why it worked) but hey, I'm not complaining. 我不知道为什么或如何改变,(或为什么它有效)但是嘿,我不是在抱怨。 For anyone else with the same issue, first do everything I said in the question body, then try this. 对于有同样问题的其他人,首先要做我在问题体中所说的一切,然后尝试这个。 It hopefully will work for you too. 它也有希望对你有用。

EDIT: I just figured out the cause of the issue as well. 编辑:我也想出了问题的原因。 I opened the workspace on another computer (my workspace is on a shared drive) running java 1.8.0_60 while this computer is running java 1.8.0_65. 我在运行java 1.8.0_60的另一台计算机(我的工作区位于共享驱动器上)上打开了工作区,而这台计算机运行的是java 1.8.0_65。 Obviously, eclipse had to change the version therefore causing problems. 显然,eclipse不得不改变版本因此导致问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM