Gene Kastyshyn
Gene Kastyshyn

Reputation: 65

java.awt.Robot works strangely under macOS Mojave

After macOS was upgraded to Mojave, java application that is using Java Robot and works absolutely fine under High Sierra, stars to work incorrectly. Symptoms are:

According to the recommendation Robot.mouseMove does not work at all in Mac OS X I have added Java and Eclipse into Security & Privacy, click the Privacy tab toward the top, then choose Accessibility. It did not solve the problem. Moreover, I could not see any difference.

I went through this link https://eclecticlight.co/2018/09/17/managing-mojaves-privacy-protection-privacy-controls/ and ran "tccutil reset AppleEvents". But I did not get expected the dialog to add the pair of apps into Privacy=>Automation section of "System preferences"

my Java is 1.8.0_191, x86_64.

Any ideas how to get that code to work in Mac OS Mojave?

Best Regards,

Upvotes: 3

Views: 1517

Answers (1)

Elango
Elango

Reputation: 51

Not sure if you found the solution already. If not, follow the steps below,

  1. Settings -> Security & Privacy
  2. Scroll down to "Accessibility"
  3. Click the lock button at the bottom and unlock the security and privacy preferences
  4. Click on '+' icon and your program (Eclipse IDE in my case) and try running again

The IDE still shows "This is NOT allowed. Please call TIS/TSM in main thread!!!" but both Keyboard and Mouse events work. I checked your code as well.

Upvotes: 2

Related Questions