43

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 :

NO JRE in System PATH

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 .

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

Sujith PS
  • 4,776
  • 3
  • 34
  • 61
user2351151
  • 725
  • 4
  • 12
  • 16
  • possible duplicate of [Eclipse - no Java (JRE) / (JDK) ... no virtual machine](http://stackoverflow.com/questions/2030434/eclipse-no-java-jre-jdk-no-virtual-machine) – Kai May 06 '13 at 08:31

12 Answers12

62

You can add this line to 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.

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

Russell Shingleton
  • 3,176
  • 1
  • 21
  • 29
Evgeniy Dorofeev
  • 133,369
  • 30
  • 199
  • 275
  • 1
    Note that you can't wrap the path in quotes when it contains spaces. If it contains spaces, put the whole path into one line as in the example! – Aaron Digulla May 06 '13 at 09:07
  • 5
    One point to add - ensure that the java Path is put in a separate line. Don't put "-vm" and the path in same line. – orasca Oct 25 '15 at 16:18
  • If you change it in the .ini file, and it still doesn't work, check the shortcut or menu item properties, where it might need to be updated, like: C:\birt_232\eclipse\eclipse.exe -vm "C:\Program Files (x86)\Java\jre1.8.0_60\bin" -vmargs -Xmx512m (or whatever your path is). – Bratch Nov 06 '15 at 17:57
22

Add this to eclipse.ini:

-vm
your_java_path\bin\javaw.exe

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

andypaxo
  • 6,171
  • 3
  • 38
  • 53
pluto
  • 390
  • 2
  • 10
10

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

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.

I NEVER add javaw.exe in the PATH.

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

Aubin
  • 14,617
  • 9
  • 61
  • 84
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.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
EL missaoui habib
  • 1,075
  • 1
  • 14
  • 24
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.

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

2

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):

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

or wherever your javaw.exe happens to be.

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

1

Add the following to the eclipse.ini :

-vm


Java_Home_Variable\bin\javaw.exe

In my Case its

-vm

H:\usr\java\jdk1.6.0_16\bin\javaw.exe
Sujith PS
  • 4,776
  • 3
  • 34
  • 61
Noname
  • 349
  • 4
  • 11
  • Yes! My eclipse.ini had the -vm option set to a path that had the old JRE. It looks like the Java installer provides a `C:\ProgramData\Oracle\Java\javapath` directory with links to the current JRE programs. – Spencer Williams Apr 06 '16 at 18:14
1

I had the same issue caused by two things:

  1. I had downloaded a 32bit Java version instead of 64bit.
  2. The eclipse.ini did not have path to javaw.exe, so as per prior posts added the statement which points to the location 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

0

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

Sujith PS
  • 4,776
  • 3
  • 34
  • 61
Dariusz
  • 21,561
  • 9
  • 74
  • 114
0

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

(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)

NBApps
  • 511
  • 5
  • 12
0

If you are using windows 8 or later:

  1. download and install the jdk or jre with all the default settings and options.
  2. Then download and install 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.

user137717
  • 2,005
  • 4
  • 25
  • 48
0

Java version used : 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

and then when i removed

javaw.exe

it worked, so it will be like

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

Sundhar
  • 149
  • 1
  • 7
  • 21