tags:

views:

41

answers:

3

In the Eclipse console, I'm getting an error that JAVA HOME is not set.

I went ahead and set it to .;C:\Program Files\Java\jre1.6.0_02\ in system variables Then I restarted eclipse, but I keep getting the same error.

What am I doing wrong?

+1  A: 

You have to set the jre inside the eclipse.

Go to Window -> Preferences

Java -> installed JREs

Daniel Moura
Under installed JREs, I can already see it there, so I guess it's already been added for me, unless there are some specific additional setups I need to do.
Kamo
+1  A: 

Create JAVA_HOME environment variable points to your JDK directory, don't put it into PATH variable.

Duy Do
but I don't have a JDK directory. My `ProgramFiles/Java` directory only contains the `jre1.6.0_02`
Kamo
Ah, you can point jre1.6.0_02 too.
Duy Do
+1  A: 

Remove the period and semicolon from the beginning, like this:

C:\Program Files\Java\jre1.6.0_02\

This is just one specific directory, not a semicolon-separated list like the system PATH variable.

Also, make sure the environment variable you create is called JAVA_HOME with an underscore between JAVA and HOME. You seem to have JAVA HOME with a space between them.

Woelfchen
Removing the period semicolon at the start did it. Thank you.
Kamo