我试图在Minecraft中设置一个用于修改的工作空间,并且收到一条错误,指出我找不到我的JAVA_HOME目录。 搞乱并安装新的JDK后,运行Eclipse表明:
为了运行Eclipse,必须提供“Java Runtime Enviroment(JRE)或Java Development Kit(JDK)”。 搜索以下位置后未找到Java虚拟机:C:\ Users \ |我的用户名| \ Desktop \ Eclipse \ jre \ bin \ javaw.exe javaw.exe是您当前的PATH“
我正在检查我的PATH和JAVA_HOME变量,它们都设置为C:\ Programm Files(x86)\ Java \ jdk1.8.0_51 eclipse正在查找的文件是java存储其javaw.exe的标准目录,即Java \ jdk1.8.0_51 \ jdk \ bin \ jawaw.exe,但Eclipse在某种程度上认为我的路径设置为Eclipse安装目录。 有谁知道如何解决这个问题?
I was trying to setup a workspace for modding in Minecraft, and got a error stating that my JAVA_HOME directory was not found. After messing around and installing a new JDK, running Eclipse states that:
"A Java Runtime Enviroment (JRE) or Java Development Kit (JDK)" must be avaiable in order to run Eclipse. No Java virtual Machine was found after searching the following locations: C:\Users\|My Username|\Desktop\Eclipse\jre\bin\javaw.exe javaw.exe is your current PATH"
I was checking my PATH and JAVA_HOME variables, which where both set to C:\Programm Files(x86)\Java\jdk1.8.0_51 The file eclipse is looking for is the standart directory where java stores its javaw.exe, i.e Java\jdk1.8.0_51\jdk\bin\jawaw.exe, but Eclipse is somehow thinking my path is set to the Eclipse installation directory. Does anyone know how to fix this issue?
最满意答案
由于文件夹名称中的空格,将JAVA_HOME设置为“c:\ program files ...”中的文件夹是个坏主意。 只要此值用作命令行参数,接收方就会将其解释为两个参数(“C:\ program”和“file ...”)。
将您的jdk移动到名称中没有空格的文件夹中,并更正您的JAVA_HOME变量。
BTW:eclipse首先解析系统PATH变量,以便找到合适的java SDK。 在eclipse.ini文件中声明所需的SDK(在eclipse install-folder中)是一个很好的做法。 添加一个参数:
.... -vm C:\JDK8\bin\javaw.exe -vmargs -Xms40m -Xmx384m请注意,-vm arg及其值必须出现在separete行上,并且必须放在-vmargs参数之前。
It is a bad idea to have JAVA_HOME set to a folder in "c:\program files..." because of the space in the folder name. Whenever this value is used as a command line argument, the receiver would interprete it as two arguments ("C:\program" and "file...").
Move your jdk into a folder without space in the name, and correct your JAVA_HOME variable.
BTW: eclipse resolves first the system PATH variable in order to find a suitable java SDK. It's a good practice, to declare the desired SDK in the eclipse.ini file (in eclipse install-folder). Add there an argument:
.... -vm C:\JDK8\bin\javaw.exe -vmargs -Xms40m -Xmx384mNote that the -vm arg and its value must appear on separete lines and must be placed just before the -vmargs argument.
更多推荐
发布评论