We have 2 java applications running on MAC. One background application sends either a text or image to a clipboard, then the other application grabs that data and paste it in it
What you are doing is generally referred to as "interprocess communication". There are various strategies to accomplish this. One of the more 'correct' approaches, in your cotext of two Java applications, would be to use Java RMI.
Doing it in a non-standard, "hackish" manner like you are with the clipboard is more problematic...as you have discovered the hard way.
Even if you did manage to get it running, the possibilities of problems in the future are high. E.g.: Imagine a Windows update changing the behavior of the clipboard--it would break your app on Windows.