2

I have a program I just finish writing in CFML (.cfm files) for my client, but I don't want my client to see the source code. I will install the software on his computer. I tried using the compile.bat but when I install it on the other computer, it gives an error (java language...). What are my options?

Alex
  • 7,743
  • 1
  • 18
  • 38
  • Are the JAVA versions of the machine on which you compile the code and the server you run the code indentical? – Bernhard Döbler Dec 20 '15 at 01:03
  • @Badware Oh.. I am not sure of that! If it is a no, how can you help? Thanks! – Loveth Young Dec 20 '15 at 01:21
  • 1
    `cfcompile.bat` calls `findjava.bat`. There a variable `JAVACMD` is set. Coldfusion prefers the JAVA that resides within the CF installation folder. That is an issue, since CF came with JAVA 7 but might be set to run with JAVA 8 in the `jvm.config`. You might resolve the variables from the command `afterdeploycompdir` and compile without using the bat file. – Bernhard Döbler Dec 20 '15 at 11:22
  • Didn't try but this alternative to cfcompile.bat looks promising https://github.com/orangexception/CFCompile-Pass-All/blob/master/cfcompile-pass-all.bat – Bernhard Döbler Dec 20 '15 at 11:24
  • Consider `cfencode`. http://stackoverflow.com/questions/14732958/can-i-get-the-source-of-a-hacked-coldfusion-template – James A Mohler Dec 20 '15 at 18:59
  • If yer gonna vote to close something, at least have the courtesy to explain how the question could be improved so as to encourage you to remove your close vote. In this context the two votes are bogus as it's *not* hard to understand what the question is about. It might be hard *for you* to understand, but that's a failing on your part, not the question's. – Adam Cameron Dec 21 '15 at 11:28
  • IF you are referring to me @Adam, i don't really get you! – Loveth Young Dec 21 '15 at 23:08
  • No, I was not referring to you. Otherwise I would have actually *referred to you*. Two people have flagged this question for closure (note the `close (2)` under the question. I was ballocking them for being unhelpful dickheads. – Adam Cameron Dec 22 '15 at 08:08

1 Answers1

3

@Bardware is correct: the target machine needs to have the same major version of Java as that which you compiled the code with, and probably for good measure the minor version should be the same or greater.

You can - of course - confront this from the other direction: find out what version of Java they have running, and compile to that version. However they will still need to be running at least the minimum Java version that is supported for the intended version of ColdFusion.

Also it's vital to note @Bardware's comment against the question itself:

cfcompile.bat calls findjava.bat. There a variable JAVACMD is set. Coldfusion prefers the JAVA that resides within the CF installation folder. That is an issue, since CF came with JAVA 7 but might be set to run with JAVA 8 in the jvm.config. You might resolve the variables from the command afterdeploycompdir and compile without using the bat file.

Adam Cameron
  • 29,677
  • 4
  • 37
  • 78