Issue w/ CF2016 not starting

From that error, it sounds like java 8 is required but not being used. Run the info command to see what’s getting used.

Hey Brad,

Yep, that fixed it, thanks! So here’s what I don’t understand…

Before I posted to this forum, I thought the same thing: that I might be on an older JRE. The Java Control Panel says I only had 1 copy of Java Runtime - 8 build 151, what was noted in my original post.

When I did “box info” per your suggestion that came back with “1.7.9”.

Moving a copy of the 1.8 JRE to /usr/bin/local fixed the issue.

But where in the heck does CommandBox get the 1.7.9 from? :slight_smile:

Thanks again,

Hi Nolan, it can defnitley be a little hard to figure out why a specific version of Java gets used, mostly because there are several different standards out there by which programs will try and detect. Some use symlinked dirs, other use environment variables, and in the case of Windows-- sometimes the registry.

In your case, we can answer that question by inspecting the small batch script that gets baked into the box binary for your Unix machine. The script can be found here:

You can see when box gets run on a *nix machine, it makes three attempts to find the version of Java to use in this order, meaning the last one to be found is the one used.

  1. Whichever binary named “java” is in the system path. You can see what java binary is in your system path by running “which java” from the bash console
  2. Then it checks for an environment variable called JAVA_HOME. You can check if your machine has an environment var of that name by running " echo $JAVA_HOME" from a bash console
  3. And finally, box looks in the same directory where the actual box binary lives to see if there is a folder called “JRE”. If there is, it will use the version of Java contained within
    And, for what it’s worth, you can also override the version of Java used for your servers in case you want to start a server with a different version of Java than you’re running the CLI with.



ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp

ColdBox Platform:

Oh, I should also point out this ticket.

I put in that ticket to combat this very scenario, where Java’s built in message pretty much sucks, but I never completed the ticket because it turned out to be more of a pain to do 100% than I thought. With Java 9 looming and it not being compatible with a lot of stuff, I might try to revisit that ticket.