You can use the cfcompile utility for the following purposes:
The cfcompile utility is located in the cf_root/bin (server configuration) or cf_webapp_root/WEB-INF/cfusion/bin (multiserver and J2EE configuration) directory.
Before you can use the cfcompile utility in the J2EE configuration, you must set the CFUSION_HOME, J2EEJAR, and WEBINF variables in the cfcompile.sh/cfcompile.bat file.
You can use the cfcompile utility to precompile ColdFusion pages (CFM, CFC, and CFR files). This can enhance initial page loading time at runtime.
Use the following command to compile ColdFusion pages into Java classes:
cfcompile webroot [directory-to-compile]
The following table describes these parameters:
Parameter |
Description |
---|---|
webroot |
Fully qualified path to the web server root; for example, C:\Inetpub\wwwroot or C:\coldfusion8\wwwroot. |
directory-to-compile |
Fully qualified path to the directory where the files to be compiled are located. This directory must be under the webroot directory. If not specified, all ColdFusion templates in the webroot directory are compiled. |
You can use the cfcompile utility with the -deploy option to create ColdFusion pages (CFM, CFC, and CFR files) that contain Java bytecode. You can then deploy the bytecode versions of the ColdFusion pages instead of the original CFML source code.
Use the following command to compile CFML files into bytecode format that you can deploy instead of CFML source code:
cfcompile -deploy webroot directory-to-compile output-directory
The following table describes these parameters:
Parameter |
Description |
---|---|
webroot |
Fully qualified path to the web server root; for example, C:\Inetpub\wwwroot or C:\coldfusion8\wwwroot. |
directory-to-compile |
Fully qualified path to the directory where the files to be compiled are located. This directory must be under the webroot directory. This is required for the -deploy option. |
output-directory |
Fully qualified path to the directory to contain the compiled deployable files. This cannot be the same directory as the source directory. |
After you run the cfcompile utility, perform the following steps: