Page 1 of 1

log4j update bat file on Windows

Posted: Thu Dec 23, 2021 7:46 pm
by wbrisett
We're running an older version of the oXygen framework inside our Ixiasoft CMS, so we're having to run the oxygen-log4j-patcher tooling. I had zero issues on macOS doing this, but our Windows users are struggling and I'm hoping maybe somebody will have some ideas on how to fix this.

java.exe exists in the their ditacms directory (example path):

c:\Users\myuser\ditacms41\jre\bin\

We've had to setup a JAVA_HOME because most, if not all, users don't have that environmental variable set.

When we run the .bat file, it complains that it can't find java.exe in JAVA_HOME. We've tried a few iterations of setting JAVA_HOME (including full java.exe as part of it). Nothing changes the message that the .bat file can't find java.exe.

When we do: cat %JAVA_HOME%, is displays the path we set. When we just use that path in a command line window, Java works. I'm stumped at what else we can do to fix this. Any ideas on why the .bat file won't find the java.exe that's in the \jre\bin directory?

Re: log4j update bat file on Windows

Posted: Thu Dec 23, 2021 7:58 pm
by cristi_talau
Hello,

You mentioned you tried several values for JAVA_HOME, including the full path to "java.exe". The JAVA_HOME should have the following format: "C:\Program Files\Java\jdk1.8.0_221", or probably "c:\Users\myuser\ditacms41\jre" in your case. Inside this folder you should have a "bin" subfolder with "java.exe" in it.

Can you check whether trying this value works?

Best,
Cristian

Re: log4j update bat file on Windows

Posted: Thu Dec 23, 2021 8:15 pm
by wbrisett
Yep!... that was the trick. We just changed JAVA_HOME and it worked when we shortened it to just stop at \jre

Thanks Cristian!