If you just want to communicate between two programs, there is no great difficulty if the device provides resources for it. Programs communicate all the time and no matter what languages they are in.
Even if you wanted Java code to communicate as C code in the same program it would still be possible through JNI . If communication is very difficult to integrate C code into Java it can be an alternative. But I already notice that it is not the easiest task.
Need to analyze whether the controller has some form of processes communicating efficiently. Eventually, in extreme cases it is necessary to use some C code next to Java to create this form of communication probably accessing memory in a shared way (there are several implications in this if the operating system does not help).
You could also use the TCP protocol to make the communication as long as both are able to make this communication. This depends on the appropriate libraries in both programs or specialized code.
In addition, you can use file sharing if the controller uses some form of storage.
You would need to look at the documentation for the driver and / or operating system that runs on it, as well as check the libraries available to it in both languages. But if none of this is possible, it's best to give up doing this on the controller.