Trying to intiate Java class but it is saying clas...
# cfml-general
u
Trying to intiate Java class but it is saying class not found
a
In future can you pls show us the actual code (and error), not a picture of it? Makes it impossible to copy & paste bits out of it. Yer just trying to reference
MultiPlatformReader
in your
createObject
call, but I presume it has a package path as well? You need to include that,
Also in Windows explorer... switch yer file extensions on! "JAVA file" doesn't tell us much. I hope it's not a
.java
file as that isn't usable. Is it a
.class
or
.jar
file? And what directory is that?
u
Sure In future I will add these refrences the file for which I am creating object has .java extension
a
Right so it's a source code file. You can't run that. You need to compile it.
s
if you are on CF 2021 then you can write java inside the CF. https://helpx.adobe.com/coldfusion/using/java-integration-coldfusion.html#java-udf-cfc
👍 1