

In the 2018 release of ColdFusion, there is a handy way to create objects in ColdFusion.
The snippet below illustrates how you can use the new operator to create different type of objects.
//ColdFusion Component
obj = new component(“path.to.cfc”)
obj.init()
// Java
obj = new java(“java.class”)
obj.init()
// WebService
obj = new webservice(“http://webservice?wsdl”, {“webservice”: “parameters”})
Similarly, you can use the new operator to create com, CORBA, and .NET objects as well.
In the 2018 release of ColdFusion, there is a handy way to create objects in ColdFusion.
The snippet below illustrates how you can use the new operator to create different type of objects.
//ColdFusion Component
obj = new component(“path.to.cfc”)
obj.init()
// Java
obj = new java(“java.class”)
obj.init()
// WebService
obj = new webservice(“http://webservice?wsdl”, {“webservice”: “parameters”})
Similarly, you can use the new operator to create com, CORBA, and .NET objects as well.

- Most Recent
- Most Relevant
Where is the new java() function documented? I can see that passing _multiple arguments_ is doing _something_. However, I cannot find the documentation to see what it is. For example, if I do this:
“`
new java( “org.jsoup.Jsoup”, “jsoup-1.14.3.jar” );
“`
I get the error:
“Jar not found in repository : /jsoup-1.14.3.jar:null”
… so clearly, the java() constructor takes more than one argument (since why else would the 2nd arg show up in the error message). But, I don’t know what signature it is looking for. Can you please point me to the documentation? Google is failing me.
Hi Adobe,
+1 to an answer to Brad’s question. What happened to the discussed/preferred syntaxes that no longer work?
Thanks!,
-Aaron
Just to be clear, this syntax calls init for you:
obj = new path.to.cfc();
but this one doesn’t:
obj = new component(“path.to.cfc”);
What happened to the other syntax I saw during the prerelease– did this go away?
new java:java.lang.String();