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

  1. 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.

  2. 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.

    Screenshot of the Enable Java Access Bridge option in the Windows Control Panel.

  3. 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:

    1. Type Configure Java in the Windows search bar.

    2. Open Java Control Panel and go to the Java tab.

    3. Select View.

      Screenshot of the Java Control Panel.

    4. 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.

      Screnshot of the Java Runtime Environment Settings.

    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
      • 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….
  4. 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.
  5. Ensure that VC_redist.x64.exe, VC_redist.x86.exe, or both are run.

    Screenshot of the installed Microsoft Visual C++ Redistributable versions.