Really ignorant question. I have a dev server runn...
# box-products
d
Really ignorant question. I have a dev server running ACF 2018 latest and java latest for that cf version, 11.0.19. As part of originally setting that up back in 2021, CommmandBox was installed. When I just tried to run it now, with
box version
, I got
This application requires a Java Runtime Environment 1.8.0
I want to update CommandBox to its latest, without breaking CF. What's the right set of steps to do that?
c
Download the latest CommandBox with JRE for your OS. Replace the
box.exe
and
jre
folder wherever you currently have box.exe stored. That's the easiest way to guarantee that you have the latest CommandBox/JRE combination.
d
Thanks Carl. Just to be clear: • box.exe is on some drive at /commandbox-jre-win64, and I want to replace that with the latest version, yes? • I'm less clear about the relevant jre. The java cf is using is in a dedicated directory for its java version, but we're not talking about replacing that I assume, right?
c
Bullet point 1 - yes. Bullet point 2 - putting a compatible JRE in the same folder as Box.exe will ensure that is the JRE that CommandBox itself will use. It won't impact any installation of ColdFusion, Lucee, etc.
It may be that back when you installed CommandBox originally, you relied on whatever JRE was installed already on your system. With the potential for conflicts with other Java-based applications, it's best to use the "CommandBox with JRE" download and place the JRE in the Box installation folder so that CommandBox is guaranteed to use that JRE.
Also, you can specify in your
server.json
what JRE to use for that particular server (whether ColdFusion or Lucee). CommandBox can download and install the openJDK version specified for you and run your server using that JDK.
d
We remove the system jre on all servers, and use one specifically installed for cf, which it's explicitly configured to use. That way we only have to keep that one up to date w security fixes, our security audit software doesn't yell at me about old jres, and it's super clear which one is involved. I already checked server.json, it's an empty object, so putting the new jre in the folder w CommandBox seems simple and clear. There's no issue with that not being the same one cf uses, or even the same version, yes?
c
No issues.
d
Thank you sir 🙂
b
@Dave Merrill I'm curious where that error came from. CommandBox proper doesn't even have any version checks I don't think outside of a min Java check perhaps.
What OS are you running this on? *nix? Windows?
The Launch4j wrapper we use has its own checks-- I just looked and I do have this in place in our build that controls the launch4j behavior
Copy code
<jre path="./jre/;%JAVA_HOME%;%JRE_HOME%;%JDK_HOME%;%PATH%" minVersion="1.8.0" maxVersion="15.0.0" />
I'm curious if that message came from Launch4j
The irony is I've been testing Java 17 locally with box on windows and I never had any issues
I'm really curious just what version of Java was getting used when you encountered that error and where the actual message came from that you saw.
If Java 11 was the only jre on the machine, this should have been no issue at all!
d
@bdw429s How would I find out the java version being used by the cmd line when I ran
box version
? None of the expressions in your
<jre path=...
statement resolve to anything except %PATH%, whose resolution doens't include any mention of "java" or "jre". So, I think it must be the one CommandBox is using. Does that make sense? Bottom line, installing CommandBox latest with the new jre in the folder with seems right.
b
@Dave Merrill The
info
command will show you what version of Java from what folder is being used.
Starting box with the
-clidebug
argument will also output the JRE in use in the first few lines of debug output
doens't include any mention of "java" or "jre".
a folder called
java
has never been any sort of convention, but a folder called
jre
is and it's listed right here:
Copy code
./jre/
as the first place that's checked