0

I have just removed version 1.8.0_202 version of java and reinstalled a newer version 1.8.0_321. Now IntelliJ is failing to "Deploy/Run WAR on Weblogic". It is failing with

The JRE was not found in directory C:\PROGRA~1\Java\JDK18~1.0_2. (JAVA_HOME)

My Environment Variables have

JAVA_HOME = C:\Program Files\Java\jdk1.8.0_321
PATH has %JAVA_HOME% and %JAVA_HOME%\bin

Using a command prompt or Bash shell I can echo JAVA_HOME and the correct value is returned.

I can run the following and it correctly finds Java and outputs the correct version

java -version

In IntelliJ I have the Project Structure -> Project Settings, Project Structure -> Platform Settings, Settings -> Build, Execution, Deployment -> Gradle all having the JDK set to the correct Java Home.

However, In IntelliJ, in a terminal if i echo $JAVA_HOME it has no value.

I have searched for a solution and all refer to ensuring you have your project settings correct which I do. I am completely baffled as to why its no longer working. Also its interesting that it mentions a completely different java version than what i am using (Java18)

enter image description here

se22as
  • 2,282
  • 5
  • 32
  • 54
  • 1
    Reboot or logout/login after changing JAVA_HOME. – CrazyCoder Apr 25 '22 at 18:27
  • Intellij terminal on Windows uses cmd.exe. You do not use `echo $JAVA_HOME` but rather `echo %JAVA_HOME%`, so it may add to the confusion. The solution is to reboot. Also, I would review the run configuration used to do the deploy and switch to project default java instead of system default JAVA_HOME for better control over this in IDE. – JockX Apr 25 '22 at 21:38
  • @CrazyCoder - Thank you for your comments. I have rebooted several times and that did not resolve the issue. – se22as Apr 26 '22 at 21:30
  • Jockx - I tried both variants for outputting JAVA_HOME, the windows and Unix version and neither show a value – se22as Apr 26 '22 at 21:31
  • jockx - I believe I have tried switching between project and system settings for java. But what is strange my system java is my 1.8.0_321 version and so is my project value. So I don't know where it could be getting the other version from – se22as Apr 26 '22 at 21:33
  • Please check [this document](https://docs.oracle.com/en/middleware/standalone/weblogic-server/14.1.1.0/wlsig/shared-updating-jdk-installing-and-configuring-oracle-fusion-middleware-product.html#GUID-4230A928-7BE8-4D23-B8F9-1CB2D4EDEC33). – CrazyCoder Apr 26 '22 at 22:28

0 Answers0