Eclipse- JDK not found

。_饼干妹妹 提交于 2019-12-12 07:33:37

问题


I have downloaded JDK 7 and Eclipse Helios, but when I open Eclipse, I get the following error

A java Runtime Environment (JRE) or Java Development kit (JDK) must be available in order 

to run Eclipse. No Java virtual machine was found after searching the following locations:

 C:\eclipse\jre\javaw.exe javaw.exe in your current PATH

I have tried to put the exact path of JDK bin folder in eclipse.ini file but it didn't work

-vm
C:\Program Files\Java\jdk1.7.0_05\bin

Can somebody tell me what is the reason behind this issue and how can I solve it.


回答1:


When I had this problem, I solved the following way (I have Windows 7):

  1. Right click on the Eclipse icon in your desktop.
  2. Properties
  3. Target: C:\eclipse\eclipse.exe -vm C:\Java\jdk1.6.0_32\jre\bin\javaw.exe

    3a (if your jdk is installed in a path like "Program Files"): C:\eclipse\eclipse.exe -vm "C:\Java\jdk1.6.0_32\jre\bin\javaw.exe"




回答2:


In your eclipse.ini file you need to specify the path to the Jave executable, not just the bin directory, as described in the Eclipse wiki. For example, like this:

-vm
C:\Program Files\Java\jdk1.7.0_05\bin\javaw.exe



回答3:


Set environment variable Path.

Path=C:\Program Files\Java\jdk1.7.0_05\bin



回答4:


It might be because you haven't downloaded Oracle... I had the same issue.




回答5:


I think that eclipse needs to read the file Java, but it does not know where it is located. I normally specify the PATH variable when I install a Java SDK. I think you need to to this, too since it complains about "your current PATH".

Oracle tells you how to do this:

http://docs.oracle.com/javase/tutorial/essential/environment/paths.html




回答6:


Windows 7

From the desktop, right click the Computer icon. Choose Properties from the context menu. Click the Advanced system settings link. Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New. In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable. Click OK. Close all remaining windows by clicking OK.

C:\Program Files\Java




回答7:


I ran into the same problem today after installing eclipse on a new PC with an up-to-date 64-bit JRE (on Windows 7 x64). Ajusting the PATH Variable as suggested resulted in the JNI file not found error.

The problem was that I was using a 32-bit eclipse with a 64-bit java runtime. On another computer there was an old 32-bit JRE installed, so the 32-bit eclipse was working. After uninstalling the 32-bit JRE, eclipse stopped working with the same error as above.

What I learned from this:

  • Even though java is cross platform, there still is a difference between 32 and 64 bit versions
  • Java JRE and the eclipse version have to match (32 or 64 bit) to run properly
  • Consequently, it might be necessary to install both - the 32 and 64 bit JRE, depending on the software used
  • When updating Java, one always has to update both versions of JRE
  • Adding the JRE folder to the PATH is not necessary, it doesn't fix the problem



回答8:


Yeah, Even i faced the same problem and found out a solution. First check whether you have installed Java Jdk . If yes then proceed.... Then go to C:\ then Program Files and look for java and in there you will find a Jdk file open it then copy the bin file and go to your adt-bundle-windows-x86_64 and place the bin file under Eclipse . Hope this works for you and happy developing ;)




回答9:


Because Eclipse and JDK "installing time" is very short. I think a clean solution will save your time.

1/ The first, JDK and Eclipse should be the same "bit" (Eclipse 32 bit go with JDK 32bit, and 64 bit so on). I think nowaday computers with large memory and modern 64 bit OS should choose the 64 bit pair.
2/ Remove all JDK version in your PC, check if its done by: Open CMD, type "java" and enter, if there is no application run, you done.
3/ Install JDK (assume JDK 8 64 bit)
4/ Download the rights version of Eclipse (zip)(assumse you download 64 bit version)
5/ Just extract eclipse and run it.

Eclipse is just a portable software which packaged in a zip, don't waste your time to fix a wrong installation. Hope this help.




回答10:


E-Riz's comment worked for me, I just had to make sure I put the command at the top of the ini file.

Inside the eclipse directory you will have an eclipse.ini, at the very top of the ini file past the directory path

-vm
C:\.....\Java\jdk1.7.0_05\bin\javaw.exe



回答11:


You don't need to edit any path. Here is what you do.

  1. Open the Eclipse folder
  2. Search "javaw" in the search.
  3. Copy "javaw" and paste it into the folder.
  4. Open Eclipse.
  5. Enjoy!

I don't know why you guys keep talking about the path. It has nothing to do with it. The dialogue box said is was only searching that folder for the javaw program.



来源:https://stackoverflow.com/questions/11590355/eclipse-jdk-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!