问题描述
如何将jar / java文件包含到我的coldfusion项目中。
目前我正在使用此行< cfscript>
How can I include jar/java files into my coldfusion project.currently I am using this line into me <cfscript>
我的目录看起来像这样
website_name
|__ Login
|__ connection
|__ display.cfm
|__ twitter
|__ com
|__ ConfigurationBuilder.java
在我的 display.cfm
文件中,我在这样的脚本中调用obj
in my display.cfm
file I am calling obj in script like this
<cfscript>
configBuilder = createObject("java", "twitter.com.ConfigurationBuilder");
</cfscript>
但是当我运行 display.com 并且错误是这个
but it gives me error on this line when I run display.com
and error is this
An exception occurred while instantiating a Java object. The class must not be
an interface or an abstract class. Error: ''.
The error occurred in website_name/login/azam/connection/display.cfm: line 57
57 : configBuilder = createObject("java", "twitter.com.ConfigurationBuilder");
如何调用我的java类以及如何调用它的函数以便我可以调用我的twitter函数。
How can I call my java class and how to call its function so that I can call my twitter function.
推荐答案
将类或jar文件添加到类路径的最简单方法是将它们放在lib目录中自动拾取。该目录位于{cf_installation} / servers / lib。这些类文件将可供所有服务器使用。
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.
这篇关于将Java文件包含到Coldfusion中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!