Include Java Files into Coldfusion

我只是一个虾纸丫 提交于 2019-12-04 08:36:45

The easiest way to add class or jar files to your class path is to simply drop them in the lib directory where they are automatically picked up. The directory is located at {cf_installation}/servers/lib. These class files will be available to all servers.

http://blogs.adobe.com/cantrell/archives/2004/07/the_definitive.html

BigMadKev

If you're using ColdFusion 10 you can use the newly built in feature to dynamically load Java Files:

Specifying custom Java library path in the Application.cfc

As surfealokesea said in their answer:

The easiest way to add class or jar files to your class path is to simply drop them in the lib directory where they are automatically picked up. The directory is located at

CF Directory(where CF is installed)
                             |__ servers/lib

These class files will be available to all servers.

You can also make your class files available only to the ColdFusion server by dropping them in

{cf_installation}/servers/default/cfmx/WEB-INF/lib.

(Note that putting them in {cf_installation}/servers/default/cfmx/WEB-INF/cfusion/lib will NOT work.)

ColdFusion 9 here:

  1. Put jars into: wwwroot/WEB-INF/lib
  2. Put classes into: wwwroot/WEB-INF/classes (class mypackage.myClass goes into subdirectory mypackage)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!