http://coldfusion.com logo
#cfml-general
Title
# cfml-general
g

gsr

05/09/2022, 8:34 PM
did anyone used it and does it work if we use external jar files to have a java code code
c

cfvonner

05/09/2022, 8:48 PM
The new (in CF 2021)
<cfjava>
tag (or the cfscript equivalent syntax) is specifically to allow you to write inline java inside of your ColdFusion code, and can import java classes if they are required in the java code that follows the import statement. However,
<cfjava>
is not designed to load an external jar to be used within normal ColdFusion code (like within a
createObject()
call).
g

gsr

05/09/2022, 9:14 PM
What if there are functions I have written in java As an example I have jar loaded using this.java settings and they are already loaded now So still possibly can use it or not
c

cfvonner

05/09/2022, 9:21 PM
If you want to use them in inline java, I think you still have to use an import statement to load them again in the context of the inline java code (since that is probably executed somewhat outside of the context of regular CFML code). Not sure though - you'd have to test it yourself to see.
g

gsr

05/09/2022, 9:22 PM
Hmm interesting Let me try it out and see what it returns
i ended up doing a jar export to the code and then using it because cfjava does not support complicated tasks, it was not even recognizing the method
2 Views