Asked  6 Months ago    Answers:  5   Viewed   23 times

I am trying to get Eclipse v3.5 (Galileo) to re-run on my computer - I have run it before with no problems, but now I keep getting this 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:eclipsejrejavaw.exe javaw.exe in your current PATH

I've just done a fresh install of both the JDK and the SDK.

I have Windows 7 (x64).

What's up with this? How do I fix it?

I can't run any of the ipconfig / tracert / or ping.

 Answers

63

Eclipse will by default try to launch with the default "java.exe" (the first one referenced by your PATH)

Three things to remember:

  • "Installing" a JRE or a JDK can be as simple as unzipping or copying it from another computer: there is no special installation steps, and you can have as many different JVM versions (1.4, 5.0, 6.0...) as you want, "installed" (copied) almost anywhere on your disk.
  • I would recommend to always run Eclipse with the lastest JRE possible (to benefit from the latest hotspot evolutions). You can:
    • Reference that exact JRE path in your eclipse.ini.
    • Copy any JRE of your in your <eclipse>/jre directory. In both cases, no PATH to update.
  • The JVM you will reference within your Eclipse session is not always the one used for launching Eclipse because:
    • You only need a JRE to launch Eclipse, but once Eclipse launched, you should register a JDK for your projects (especially for Java sources and debugging purposes, also in theory for compilation but Eclipse has its own Java compiler) Note: You could register just a JRE within Eclipse because it is enough to run your program, but again a JDK will allow for more operations.
    • Even though the default registered Java in Eclipse is the one used to launch the session, you can want to register an older SDK (including a non-Sun one) in order to run/debug your programs with a JRE similar to the one which will actually be used in production.

Installed JREs


June 2012, jmbertucci comments:

I'm running Windows 7 64-bit and I had the 32-bit JRE installed. I downloaded Eclipse 64-bit which looks for a 64-bit JRE. Because I didn't have the 64-bit JRE it threw the error, which makes sense.

I went to the Java manual install page (which was not as directly accessible as you'd like) and installed the 64-bit version. See "Java Downloads for All Operating Systems". That was all I needed.


April 2016: Steve Mayne adds in the comments:

I had to edit the eclipse.ini file to reference the correct Java path - Eclipse doesn't use the environment PATH at all when there is a value in eclipse.ini.

Tuesday, June 1, 2021
 
Troncoso
answered 6 Months ago
60

I found the answer over on Ask Different

It's an ugly hack, but works perfectly.

Monday, August 2, 2021
 
Gaurav
answered 4 Months ago
85

Another option is to use maven/m2eclipse to manage your dependencies.

It's way overkill if you have the problem for 1 or 2 libraries, but worth considering if you have a dozen.

Most open source projects publish both the jar and the -src.jar artifacts, and m2eclipse can go and download automatically the source for you.

Wednesday, August 11, 2021
 
Alexander Trauzzi
answered 4 Months ago
18

Wildcards are limited in that they break recursive expressions like T extends X<T> that type parameters allow. We know what you're trying to do is safe based on the following:

  1. r.o is of type T (declared by R), which is or extends N<T>.
  2. The method p takes an argument of type T (declared by p), which also is or extends N<T>.
  3. So even though r is typed as R<?>, a call p(r.o) should theoretically be legal.

This is possibly the reasoning of the eclipse compiler (known to make correct allowances for certain nuances of generics where javac doesn't).

Assuming you want to compile with javac and can't change the signature of v like you mentioned, the best you can do is resort to using a raw type, which "opts out" of generic type checking:

public void v(final R<?> r) {
    //necessary to placate javac - this is okay because [insert above reasoning]
    @SuppressWarnings("rawtypes")
    N nRaw = r.o;
    p(nRaw);
}
Wednesday, August 18, 2021
 
etsous
answered 4 Months ago
61

I had two Volley dependencies in my gradle dependencies so i guess thats what caused it all

compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'

i just took this one out

compile 'com.mcxiaoke.volley:library:1.0.19'

now everything works fine

Tuesday, November 23, 2021
 
viky
answered 7 Days ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :  
Share