Can't access the elements of a Java application
If you encounter issues while automating Java applications with Power Automate for desktop, follow the steps in this article to troubleshoot the issue.
Applies to: Power Automate
Original KB number: 5014922
Symptoms
Power Automate for desktop can't access the UI elements of a Java desktop application when you use either the Recorder or the Add UI element action in the flow designer.
Troubleshooting steps
Ensure that you have Java installed on your machine:
Open the Command Line tool (cmd) and run the following command:
java –version
If Java isn't installed, you receive an error message:
'java' is not recognized as an internal or external command, operable program or batch file.
Ensure that the Enable Java Access Bridge option is disabled in the Control Panel.
Go to Control Panel > Ease of Access > Optimize visual display > Java Access Bridge from Oracle, Inc. Providing Assistive Technology access to Java applications, and then disable the Enable Java Access Bridge option.
Ensure that specific files exist in one or more Java folders of the machine after the Power Automate for desktop installation.
To check the installed Java version and installation path on your machine:
Type Configure Java in the Windows search bar.
Open Java Control Panel and go to the Java tab.
Select View.
Check the values in the Path column. The Architecture row with value x86 refers to 32-bit Java installation, while the row with value x64 refers to 64-bit Java installation.
Check that the following files exist:
For 64-bit Java installation:
- File Microsoft.Flow.RPA.Desktop.UIAutomation.Java.Bridge.Native.dll is replaced in folder C:\Program Files\Java\jre1.8.0_271\bin. (replace jre1.8.0_271 with your machine's Java installation folder.)
- File accessibility.properties is replaced in folder C:\Program Files\Java\jre1.8.0_271\lib. (replace jre1.8.0_271 with your machine's Java installation folder.)
- If you open the file with Notepad, you should see the following value:
assistive_technologies=com.sun.java.accessibility.AccessBridge, microsoft.flows.rpa.desktop.uiautomation.JavaBridge
- If you open the file with Notepad, you should see the following value:
- File PAD.JavaBridge.jar is inserted in folder C:\Program Files\Java\jre1.8.0_271\lib\ext. (replace jre1.8.0_271 with your machine's Java installation folder.)
For 32-bit Java installation:
- Check the same files but in folder C:\Program Files (x86) \Java….
Check .accessibility.properties file:
- Ensure there isn't an .accessibility.properties file in your C:\Users\user folder. (replace user with your user name.)
- If the file exists, rename it.
Ensure that VC_redist.x64.exe, VC_redist.x86.exe, or both are run.