Tim Mitchell Tim Mitchell - 1 year ago 492
Java Question

Eclipse error: JRE is selected, but the path is invalid

I have a Java web application I work on using an Eclipse IDE. I'm using WebLogic 12c.

I recently had the jdk upgraded from jdk1.7.0_55 to jdk1.7.0_79.

Since then, I can't get anything to build; and I can't even start my local WebLogic server.

I reset my JAVA_HOME environment variable to the new path, and I also opened the properties of the project - and set the JRE System Library to jdk1.7.0_79.

However, no dice. If I try to build using my ANT script, I get the following error:

enter image description here

So it's obviously still looking for the old jdk1.7.0_55 installation - but I don't know why or where.

Then if I even try to start the localhost server, I get this

enter image description here

If I try to add a new server, I get the same error.

Any suggestions?


Answer Source

In your weblogic installation (or more exactly, in your domain), check the file setDomainEnv.cmd. Weblogic stores some absolute paths to the jdk itself. You will have to edit this file manually.

Sample paths from my machine for comparison:

wls12130\user_projects\domains\mydomain\bin\setDomainEnv.cmd (3 hits)
    Line 46: set SUN_JAVA_HOME=C:\develop\jdk1.8.0_66
    Line 48: set DEFAULT_SUN_JAVA_HOME=C:\develop\jdk1.8.0_66
    Line 65:        set JAVA_HOME=C:\develop\jdk1.8.0_66