[CommandBox 1.0.0.00134] Install Problems on Windows7 x64 - Java Path

I downloaded commandbox-bin-1.0.0.zip, unpacked it to c:/temp
and then

C:\temp>box
Error running CommandBox: This application requires a Java Runtime Environment 1
.6.0

C:\temp>echo %java_home%
c:\apps\java

C:\temp>echo %jre_home%
c:\apps\java

C:\temp>java -version
java version “1.7.0_65”
Java™ SE Runtime Environment (build 1.7.0_65-b19)
Java HotSpot™ 64-Bit Server VM (build 24.65-b04, mixed mode)

I’ve got the same message if i used commandbox-jre-win64-1.0.0.zip

So how detects commandbox the java environment ?

And btw i thought commandbox requires java 1.7 but the error message states 1.6.0

best regards
andreas

That’s an interesting behavior. The Java version check is being enforced by the launch4j library that we use to wrap the executable jar as an exe. You can see our config for that here:

https://github.com/Ortus-Solutions/commandbox/blob/master/build/build.xml#L225

I’m not sure off the top of my head how launch4j checks that so I’ll have to double check.

Here’s the docs, but they’re not very speciific on where launch4j searches for Java
http://launch4j.sourceforge.net/docs.html#Configuration_file

Here is one of several forums I found that indicate that launch4j uses your Windows registry to see what version of Java you have installed:
http://www.liferay.com/community/forums/-/message_boards/message/24574987

Can you look in your registry and tell me what the value of this key is:

[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\CurrentVersion]

That might help us narrow down why your 1.7 version isn’t being found.

As far as the version we support, we started out with 1.6 and at some point it got changed to 1.7 though I can’t remember if there was a specific feature of 1.7 we needed to use or it just seemed like a good idea at the time. Luis, do you recall? Nonetheless, I agree with you that we should get them consistent.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Oh, and right after I hit send I realized this was on the ColdBox list. i’m happy to answer here, but please post future CommandBox questions to our new, dedicated CommandBox list:

https://groups.google.com/a/ortussolutions.com/forum/#!forum/commandbox

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Hi Brad

Thanks for your answer.

I use a server jre (server-jre-7u67-windows-x64.tar.gz) without installer and set the java_home and path environment variable by script to keep multiple dev Machines up2date.

It seems launch4j scans only the registry and their i have no keys for java.

I installed a "normal" java in a clean Win7 VirtualMachine and there i got Registry Keys under [HKEY_LOCAL_MACHINE\SOFTWARE\Wow432Node\JavaSoft\Java Runtime Environment\CurrentVersion] and commandbox works fine.

To fix my problem, i made a custom build for commandbox with a hardcoded path in the launch4j config
<launch4j>
   <config headerType="console"
  .....
  <jre path="c:/apps/java/" minVersion="1.6.0" />

and now commandbox works on all our dev machines.

Thanks for your support
andreas

Hmm, not sure how would we globalize this for other windows users?

Luis Majano
CEO
Ortus Solutions, Corp

P/F: 1-888-557-8057
Direct: (909) 248-3408

ColdBox Platform: http://www.coldbox.org
ContentBox Platform: http://www.gocontentbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Social: twitter.com/ortussolutions | twitter.com/coldbox | twitter.com/lmajano | twitter.com/gocontentbox

I’m not sure what you mean “globalize”. Do you mean change it to check the environment variables as well as/instead of the registry?

We could check the launch4j docs to see if they have settings for this. Since this check really needs to run in native code prior to any Java executing, the only other way I can think of would be to wrap the jar via some other method, or to switch CommandBox to use some sort of installer (like installanywhere) that could perform those checks first).

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com