使用JRE路径设置Eclipse

时间:2021-03-21 23:24:24

I have downloaded and extracted Eclipse. I have Eclipse in the following directory: C:\Applications\eclipse. When I try and run the executable , I get the following message :

我已经下载并提取了Eclipse。我将Eclipse放在以下目录中:C:\应用程序\ Eclipse。当我尝试运行可执行文件时,我得到以下消息:

使用JRE路径设置Eclipse

I currently have the following folder:

我目前有以下文件夹:

C:\Program Files (x86)\Java\jre7

Do I need to set up some environment variables for my Windows 7 OS to get Eclipse to run ? If so , may I please have some help to do this ? If not , can I please have some help to get Eclipse to run .

我需要为Windows 7操作系统设置一些环境变量以使Eclipse运行吗?如果是的话,我能帮你吗?如果没有,我是否可以得到一些帮助来运行Eclipse。

EDIT

编辑

I have changed the shortcut to include the path to the Virtual Machine , and am now getting this error :

我更改了快捷方式,以包含到虚拟机的路径,现在我得到了这个错误:

http://www.canning.co.nz/Eclipse/Eclipse_Message2.png

http://www.canning.co.nz/Eclipse/Eclipse_Message2.png

12 个解决方案

#1


56  

You can add this line to eclipse.ini :

您可以将这一行添加到eclipse。ini:

-vm 
D:/work/Java/jdk1.6.0_13/bin/javaw.exe  <-- change to your JDK actual path
-vmargs <-- needs to be after -vm <path>

But it's worth setting JAVA_HOME and JRE_HOME anyway because it may not work as if the path environment points to a different java version.

但是无论如何,设置JAVA_HOME和JRE_HOME都是值得的,因为它可能不能工作,就好像路径环境指向不同的java版本一样。

Because the next one to complain will be Maven, etc.

因为下一个要抱怨的是Maven等等。

#2


20  

Add this to eclipse.ini:

添加这个eclipse.ini:

-vm
your_java_path\bin\javaw.exe

...but be aware that you must add these lines before -vmargs

…但是要注意,必须在-vmargs之前添加这些行

#3


9  

I have several version of JDK (not JRE) instaled and I launch Eclipse with:

我安装了几个版本的JDK(不是JRE),我用以下方式启动Eclipse:

C:\eclipse\eclipse.exe -vm "%JAVA_HOME%\bin\javaw.exe" -data f:\dev\java\2013

As you can see, I set JAVA_HOME to point to the version of JDK I want to use.

如您所见,我将JAVA_HOME设置为指向要使用的JDK版本。

I NEVER add javaw.exe in the PATH.

我从来没有添加javaw。exe的路径。

-data is used to choose a workspace for a particular job/client/context.

-data用于为特定的作业/客户端/上下文选择工作区。

#4


7  

Add the following -vm D:/Java/jdk1.6.0_30/bin/javaw.exe in the begin of eclipse.ini like this :

添加以下-vm D:/Java/jdk1.6.0_30/bin/javaw。在eclipse的开始。ini是这样的:

-vm
  D:/Java/jdk1.6.0_30/bin/javaw.exe
  -startup
  plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
  --launcher.library
  plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20130807-1835
  -product
   org.eclipse.epp.package.jee.product
   --launcher.defaultAction
   openFile
   --launcher.XXMaxPermSize
   1024M
   -showsplash
   org.eclipse.platform
    --launcher.XXMaxPermSize
   1024m
    --launcher.defaultAction
   openFile
   --launcher.appendVmargs
   -vmargs
   -Dosgi.requiredJavaVersion=1.6
   -Xms1024m
   -Xmx2048m

#5


2  

This may sound dumb, but it may be a fresh, or damaged install, so is the JDK installed? If not, go to the download site and download the latest version of Java JRE. Like I said, this may sound dumb, but it solved my problem.

这听起来可能很傻,但它可能是一个新的、损坏的安装,那么JDK安装了吗?如果没有,请访问下载站点并下载Java JRE的最新版本。就像我说的,这听起来很傻,但它解决了我的问题。

http://www.oracle.com/technetwork/java/javase/downloads/index.html

http://www.oracle.com/technetwork/java/javase/downloads/index.html

#6


1  

Add the following to the eclipse.ini :

向eclipse添加以下内容。ini:

-vm


Java_Home_Variable\bin\javaw.exe

In my Case its

-vm

H:\usr\java\jdk1.6.0_16\bin\javaw.exe

#7


1  

I had the same issue caused by two things:

我有同样的问题是由两件事引起的:

  1. I had downloaded a 32bit Java version instead of 64bit.
  2. 我下载了一个32位的Java版本,而不是64位。
  3. The eclipse.ini did not have path to javaw.exe, so as per prior posts added the statement which points to the location java.
  4. eclipse。ini没有通向javaw的路径。exe,以便按照前面的帖子添加指向java位置的语句。

So after I uninstalled the 32 bit Java 1.7, installed the correct one and added the javaw.exe path, eclipse fired up with no more errors

因此,在卸载32位Java 1.7之后,安装了正确的Java 1.7并添加了javaw。在exe路径中,eclipse没有再出现错误

#8


1  

You should specify where Eclipse should find your JDK in the file eclipse.ini. Specifically, the following parameter (note that it is 2 separate lines in the ini file):

您应该指定Eclipse应该在eclipsee .ini文件中找到JDK的位置。具体来说,下面的参数(注意在ini文件中是两行独立的代码):

-vm
C:\Java\JDK\1.8\bin\javaw.exe

or wherever your javaw.exe happens to be.

或者其他你javaw。exe。

Note: The format of the ini file is very particular; make sure to consult https://wiki.eclipse.org/Eclipse.ini to ensure you get it exactly right

注意:ini文件的格式非常特殊;一定要咨询https://wiki.eclipse.org/Eclipse.ini,以确保你完全正确。

#9


0  

You are most probably missing PATH entries in your windows. Follow this instruction : How do I set or change the PATH system variable?

您很可能会在窗口中丢失路径条目。遵循这个指令:如何设置或更改路径系统变量?

#10


0  

I just copied the jre folder to whatever path the message tells me it was missing at, and solved it.

我只是将jre文件夹复制到消息告诉我的任何路径,并解决了它。

(after editing the JAVA_HOME and editing the eclipse.ini didn't worked (as i probably did something wrong)) (i have no other java applications running so it's not affecting me)

(在编辑JAVA_HOME并编辑eclipse之后。ini没有工作(因为我可能做错了))(我没有其他的java应用程序运行,所以它没有影响到我)

#11


0  

If you are using windows 8 or later:

如果您正在使用windows 8或更高版本:

  1. download and install the jdk or jre with all the default settings and options.
  2. 下载并安装jdk或jre,其中包含所有默认设置和选项。
  3. Then download and install eclipse.
  4. 然后下载并安装eclipse。

Everything should work fine. I don't know if it works exactly the same for other OS, but you don't have to set the PATH manually in Windows 8 or later.

一切都应该工作好。我不知道它对其他操作系统是否完全相同,但您不必在Windows 8或以后手动设置路径。

#12


0  

Java version used : 1.8 IDE : Eclipse Neon

使用Java版本:1.8 IDE: Eclipse Neon

Adding like the below didn't work for me

像下面这样添加对我来说是行不通的

-vm [relative java home]/jdk1.8.0_21/bin/javaw.exe

相对java vm(家)/ jdk1.8.0_21 / bin / javaw.exe

and then when i removed

然后当我移除

javaw.exe

javaw.exe

it worked, so it will be like

它起作用了,就像

-vm [relative java home]/jdk1.8.0_21/bin/

相对java vm(家)/ jdk1.8.0_21 / bin /

#1


56  

You can add this line to eclipse.ini :

您可以将这一行添加到eclipse。ini:

-vm 
D:/work/Java/jdk1.6.0_13/bin/javaw.exe  <-- change to your JDK actual path
-vmargs <-- needs to be after -vm <path>

But it's worth setting JAVA_HOME and JRE_HOME anyway because it may not work as if the path environment points to a different java version.

但是无论如何,设置JAVA_HOME和JRE_HOME都是值得的,因为它可能不能工作,就好像路径环境指向不同的java版本一样。

Because the next one to complain will be Maven, etc.

因为下一个要抱怨的是Maven等等。

#2


20  

Add this to eclipse.ini:

添加这个eclipse.ini:

-vm
your_java_path\bin\javaw.exe

...but be aware that you must add these lines before -vmargs

…但是要注意,必须在-vmargs之前添加这些行

#3


9  

I have several version of JDK (not JRE) instaled and I launch Eclipse with:

我安装了几个版本的JDK(不是JRE),我用以下方式启动Eclipse:

C:\eclipse\eclipse.exe -vm "%JAVA_HOME%\bin\javaw.exe" -data f:\dev\java\2013

As you can see, I set JAVA_HOME to point to the version of JDK I want to use.

如您所见,我将JAVA_HOME设置为指向要使用的JDK版本。

I NEVER add javaw.exe in the PATH.

我从来没有添加javaw。exe的路径。

-data is used to choose a workspace for a particular job/client/context.

-data用于为特定的作业/客户端/上下文选择工作区。

#4


7  

Add the following -vm D:/Java/jdk1.6.0_30/bin/javaw.exe in the begin of eclipse.ini like this :

添加以下-vm D:/Java/jdk1.6.0_30/bin/javaw。在eclipse的开始。ini是这样的:

-vm
  D:/Java/jdk1.6.0_30/bin/javaw.exe
  -startup
  plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
  --launcher.library
  plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20130807-1835
  -product
   org.eclipse.epp.package.jee.product
   --launcher.defaultAction
   openFile
   --launcher.XXMaxPermSize
   1024M
   -showsplash
   org.eclipse.platform
    --launcher.XXMaxPermSize
   1024m
    --launcher.defaultAction
   openFile
   --launcher.appendVmargs
   -vmargs
   -Dosgi.requiredJavaVersion=1.6
   -Xms1024m
   -Xmx2048m

#5


2  

This may sound dumb, but it may be a fresh, or damaged install, so is the JDK installed? If not, go to the download site and download the latest version of Java JRE. Like I said, this may sound dumb, but it solved my problem.

这听起来可能很傻,但它可能是一个新的、损坏的安装,那么JDK安装了吗?如果没有,请访问下载站点并下载Java JRE的最新版本。就像我说的,这听起来很傻,但它解决了我的问题。

http://www.oracle.com/technetwork/java/javase/downloads/index.html

http://www.oracle.com/technetwork/java/javase/downloads/index.html

#6


1  

Add the following to the eclipse.ini :

向eclipse添加以下内容。ini:

-vm


Java_Home_Variable\bin\javaw.exe

In my Case its

-vm

H:\usr\java\jdk1.6.0_16\bin\javaw.exe

#7


1  

I had the same issue caused by two things:

我有同样的问题是由两件事引起的:

  1. I had downloaded a 32bit Java version instead of 64bit.
  2. 我下载了一个32位的Java版本,而不是64位。
  3. The eclipse.ini did not have path to javaw.exe, so as per prior posts added the statement which points to the location java.
  4. eclipse。ini没有通向javaw的路径。exe,以便按照前面的帖子添加指向java位置的语句。

So after I uninstalled the 32 bit Java 1.7, installed the correct one and added the javaw.exe path, eclipse fired up with no more errors

因此,在卸载32位Java 1.7之后,安装了正确的Java 1.7并添加了javaw。在exe路径中,eclipse没有再出现错误

#8


1  

You should specify where Eclipse should find your JDK in the file eclipse.ini. Specifically, the following parameter (note that it is 2 separate lines in the ini file):

您应该指定Eclipse应该在eclipsee .ini文件中找到JDK的位置。具体来说,下面的参数(注意在ini文件中是两行独立的代码):

-vm
C:\Java\JDK\1.8\bin\javaw.exe

or wherever your javaw.exe happens to be.

或者其他你javaw。exe。

Note: The format of the ini file is very particular; make sure to consult https://wiki.eclipse.org/Eclipse.ini to ensure you get it exactly right

注意:ini文件的格式非常特殊;一定要咨询https://wiki.eclipse.org/Eclipse.ini,以确保你完全正确。

#9


0  

You are most probably missing PATH entries in your windows. Follow this instruction : How do I set or change the PATH system variable?

您很可能会在窗口中丢失路径条目。遵循这个指令:如何设置或更改路径系统变量?

#10


0  

I just copied the jre folder to whatever path the message tells me it was missing at, and solved it.

我只是将jre文件夹复制到消息告诉我的任何路径,并解决了它。

(after editing the JAVA_HOME and editing the eclipse.ini didn't worked (as i probably did something wrong)) (i have no other java applications running so it's not affecting me)

(在编辑JAVA_HOME并编辑eclipse之后。ini没有工作(因为我可能做错了))(我没有其他的java应用程序运行,所以它没有影响到我)

#11


0  

If you are using windows 8 or later:

如果您正在使用windows 8或更高版本:

  1. download and install the jdk or jre with all the default settings and options.
  2. 下载并安装jdk或jre,其中包含所有默认设置和选项。
  3. Then download and install eclipse.
  4. 然后下载并安装eclipse。

Everything should work fine. I don't know if it works exactly the same for other OS, but you don't have to set the PATH manually in Windows 8 or later.

一切都应该工作好。我不知道它对其他操作系统是否完全相同,但您不必在Windows 8或以后手动设置路径。

#12


0  

Java version used : 1.8 IDE : Eclipse Neon

使用Java版本:1.8 IDE: Eclipse Neon

Adding like the below didn't work for me

像下面这样添加对我来说是行不通的

-vm [relative java home]/jdk1.8.0_21/bin/javaw.exe

相对java vm(家)/ jdk1.8.0_21 / bin / javaw.exe

and then when i removed

然后当我移除

javaw.exe

javaw.exe

it worked, so it will be like

它起作用了,就像

-vm [relative java home]/jdk1.8.0_21/bin/

相对java vm(家)/ jdk1.8.0_21 / bin /