"Creating and using a simple Java class" tutorial from docs doesn't work
Hi everybody.
I am trying to follow this tutorial on creating a simple Java class and using it in a simple ColdFusion 10 app, but with no luck.
I believe I am doing everything as the tutorial says, I create an Employee.java file and compile it with javac (I think mine one is from jdk1.7.0_02). I add javaSettings to Application.cfc like the following:
Application.cfc
...
this.javaSettings.loadPaths = [ExpandPath('./jars')];
this.javaSettings.loadColdFusionClassPath = false;
this.javaSettings.reloadOnChange = true;
...
Index.cfm
<p>Starting..</p>
<cfobject action="create" type="java" class="Employee" name="emp">
<p>Are we still running?</p>
<!--- <cfset emp.init()> --->
<cfset emp.firstname = "john">
<cfset emp.lastname = "doe">
<cfset firstname = emp.firstname>
<cfset lastname = emp.lastname>
<cfoutput>
Employee name is #firstname# #lastname#
</cfoutput>
<p>Finishing..</p>
Folder strcuture
Application.cfc
index.cfm
jars/
Employee.class
When I try to run this code, I get only "Starting..". Laterally. Everything after cfobject tag just seems not to be evaluated at all. Zero. Even static content like "Are we still running?" and "Finishing.." is not being output to the page.
If I try to cfdump "emp", I still get nothing (nothing is output to the page.. like absolute zero, no contents at all).
And it doesn't show any error. For the sake of testing I even tried to deliberately misspell class name in "class" attribute to make sure exception is thrown, and it is thrown if class name is incorrect. But not with the code shown above.
I am running ACF10 (with update 6) on Windows 7.
How can I get this simple example to work?
Thank you.
