box.exeon Windows, the registry is used to determine the current versions of java that are installed. If you install a some non-Oracle JRE such as Corretto, you will not currently have the necessary registry entries created for box to find Java.
boxbinary on *nix uses your OS environment variables to locate Java. In the absense of an env var called
JAVA_HOME, box will look for
javain the default system path.
JAVA_HOMEenv var on a *nix system, edit your
/etc/profilefile to have these lines. Adjust the path as necessary based on your installation.
JREin the same directory as the
box.exebinary that contains the JRE you wish CommandBox to use. This will bypass all registry and env var checks above.
/usr/local/bin/which points to the
boxbinary in the
/usr/local/Cellar/commandbox/<version>/bin/directory. If you want CommandBox to use a particular version of the
JREthen put the
jrefolder in the
/usr/local/bin/directory. If you want CommandBox to have a different home
.CommandBoxdirectory, place your
commandbox.propertiesfile in the
-clidebugflag when starting CommandBox and the first few lines will tell you what version of Java is being used, and where on disk it lives.