Thanks for the suggestions, eventually I had to go a different code route as there were differences between release and debug in the IDE runs.
In case anyone else needs to call a b4j Class module sub from a java library I found the simplest way was to add a dummy sub to the class module.
Public Sub semaphore() ' Dummy method
End Sub
I then just check the number of parameters it expects, if none , then I call other subs as normal. If it needs 1 parameter I call them with the class instance as the first parameter.