Provides support for writing Java code within ColdFusion.

  <cfjava handle="classInstance">


This tag requires Adobe ColdFusion 2021 and up.  Not supported on Lucee, etc.

Attribute Reference

handle variableName

The variable that holds the value of class instance of the Java code.

Links more information about cfjava

Sample code using the cfjava tag

<cfjava handle="nameInstance">
    public class Name {
        private String firstName;
        private String lastName;

        public Name(String firstName, String lastName) {
            this.firstName = firstName;
            this.lastName = lastName;

        public String getFullName() {
            return firstName + " " + lastName;
<cfset nameInstance.init("John", "Doe")>
<cfset fullName = nameInstance.getFullName()>

Expected Result: John Doe

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub