Seemingly simple JLink Java/Kotlin statement not working

This simple JLInk statement seems to be failing in my Java/Kotlin program. The statement is,

ml.evaluate("""hdf5dir = SetDirectory[ ":\\tsi\\SHVID\\dat\\MP\\MP-SD"]""")
ml.waitForAnswer()
val hdfdir:String = ml.string

the variable hdfdir is showing “$Failed” in the Intellij Idea debugger.
I’ve tried other variations. I used single quotes for the argument string and escaped the single quotes withing the string. I’ve tried ml.getString(). I get the same result no matter what I try. The basic Mathematica statement Head[] is a string in a notebook.
Any ideas how to remedy this?
Thanks.