简体   繁体   English

为什么Eclipse在Windows中使用c:\\​​ WINDOWS \\ SYSTEM32 \\ javaw.exe?

[英]Why is Eclipse using c:\WINDOWS\SYSTEM32\javaw.exe in Windows?

I installed java in C:\\java\\jdk1.7.0_51 location. 我在C:\\ java \\ jdk1.7.0_51位置安装了Java。 but Eclipse using c:\\WINDOWS\\SYSTEM32\\javaw.exe. 但是Eclipse使用c:\\​​ WINDOWS \\ SYSTEM32 \\ javaw.exe。

I am getting problem "Missing artifact com.sun:tools:jar:1.6" while maven build. 我在构建Maven时遇到问题“缺少工件com.sun:tools:jar:1.6”。 I saw one of the solutions that add below line in eclipse.ini 我看到了在eclipse.ini中添加以下行的解决方案之一

-vm C:\java\jdk1.7.0_51\bin\javaw.exe

So, I added and placed in eclipse.ini, after Eclipse not opening by clicking the eclipse.exe instead of that it showing one window, that having two! 因此,我添加并放置在eclipse.ini中,在Eclipse无法通过单击eclipse.exe而不是通过打开eclipse.exe来显示一个窗口的情况下,即有两个窗口!

请找到图片

-vm parameters one I added and other -vm c:\\WINDOWS\\SYSTEM32\\javaw.exe . 我添加了-vm参数,另一个添加了-vm c:\\WINDOWS\\SYSTEM32\\javaw.exe So after removed " -vm C:\\java\\jdk1.7.0_51\\bin " from eclipse.ini then it working again. 因此,从eclipse.ini中删除了“ -vm C:\\java\\jdk1.7.0_51\\bin ”之后,它又可以正常工作了。 If I am wrong, that mean it is using c:\\WINDOWS\\SYSTEM32\\javaw.exe. 如果我错了,那意味着它正在使用c:\\​​ WINDOWS \\ SYSTEM32 \\ javaw.exe。

Why it is using from c:\\WINDOWS\\SYSTEM32\\javaw.exe , why it not using C:\\java\\jdk1.7.0_51\\bin\\javaw.exe ? 为什么从c:\\WINDOWS\\SYSTEM32\\javaw.exe使用它,为什么不从C:\\java\\jdk1.7.0_51\\bin\\javaw.exe呢?

How to change to C:\\java\\jdk1.7.0_51\\bin\\javaw.exe ? 如何更改为C:\\java\\jdk1.7.0_51\\bin\\javaw.exe

Place the -vm behind openFile, and the path in a new line 将-vm放在openFile后面,并将路径换行

openFile 打开文件
-vm -vm
C:\\java\\jdk1.7.0_51\\bin\\javaw C:\\ java \\ jdk1.7.0_51 \\ bin \\ javaw
--launcher.appendVmargs --launcher.appendVmargs

Make sure to have your path variable with the desired java before the System32 folder. 确保在System32文件夹之前,将路径变量与所需的Java一起使用。 Something like 就像是

C:\Program Files\Java\jdk1.7.0_55\bin;%SystemRoot%\system32;

or after seeing your comment, to 或在看到您的评论后,

PATH=C:\java\jdk1.7.0_51\bin;%PATH%;

when typing eg java.exe, the program will be searched in the location defined in PATH in the order of defining. 当键入例如java.exe时,将按照定义的顺序在PATH中定义的位置中搜索程序。 That's why the order counts 这就是为什么订单很重要

If the system32 is before your java path, it will use the SDK as definied in your registry key, which is the latest installed java, if this is not what you want you can fix it by re-ordering the locations in the PATH variable 如果system32在Java路径之前,它将按照您的注册表项中定义的SDK使用SDK,这是最新安装的Java,如果不是您想要的,则可以通过对PATH变量中的位置重新排序来修复它

UPDATE with respect to the comments, 关于评论的更新,

with the path properly set, try removing the absolute file from eclipse.ini, leaving only javaw.exed 在正确设置路径的情况下,尝试从eclipse.ini中删除绝对文件,仅保留javaw.exed

I'll add yet another answer since I don't see one that I find 100% correct - its not really important where exactly you put the lines in the ini file, just as long as you stick to two rules: 我将再添加一个答案,因为我看不到一个100%正确的答案-只要您遵循两个规则,将行确切放置在ini文件中的位置并不重要。

  1. don't put the lines half-way in the middle of another parameter configuration 不要将线放在另一个参数配置的中间
  2. the -vm and the path need to be on two separate lines -vm和路径需要在两行中

so if you simply put 所以如果你只是把

-vm
c:/java/jdk1.7.0_51/bin/javaw.exe

at the very top of the eclipse.ini file you should be fine, Eclipse should boot up and it should not attempt to want to put a default -vm line in there itself anymore. 在eclipse.ini文件的最顶部,您应该没问题,Eclipse应该启动,并且它不应该再尝试在其自身中放置默认的-vm行。 Assuming the path is valid of course. 假设路径当然是有效的。

Try to edit it in 尝试在其中进行编辑

Windows > Preferences > Java > Installed JREs

You can specify default jre for newly created projects, while having different JREs installed. 您可以为新创建的项目指定默认的jre,同时安装不同的JRE。

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

相关问题 从Windows 7中的VBA宏绕过System32 / SysWOW64 javaw.exe运行Java - Running java from VBA macro in Windows 7 bypassing System32 / SysWOW64 javaw.exe 删除C:\\ Windows \\ System32 \\ {java,javaw,javaws} .exe是否可以防止Java恶意软件? - Does removing C:\Windows\System32\{java,javaw,javaws}.exe prevent Java malware? 为什么在Windows任务管理器中将Eclipse视为“ javaw.exe”? - Why do I see Eclipse as 'javaw.exe' in Windows task manager? 为什么Windows 8上没有退出javaw.exe? - Why isn't javaw.exe exiting on Windows 8? 使用javaw.exe时,System.getProperty(“ os.name”)在Windows Vista上返回“ Windows XP”,但是java.exe可以工作 - System.getProperty(“os.name”) returns “Windows XP” on a Windows Vista when using javaw.exe, but java.exe works 在Windows 64中javaw.exe进程消耗更多内存吗? - Does javaw.exe process in windows 64 consuming more memory? 如何在Windows中杀死Java进程而不杀死javaw.exe? - How to Kill Java Process in Windows, WITHOUT killing javaw.exe? Javaw.exe 应用程序未打开,WIndows 10 Pro Surface Pro 4 - Javaw.exe application not opening, WIndows 10 Pro Surface Pro 4 Windows XP无法在关机时终止javaw.exe - windows XP can't terminate javaw.exe on shutdown Eclipse 5.0的Javaw.exe问题 - Javaw.exe problem with Eclipse 5.0
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM