Skip to content

Commit 05cd86a

Browse files
authored
Merge pull request #10253 from iomimtso/revise-java-automation-issues
AB#8923: Update java automation issues troubleshooting steps
2 parents fdb84da + 7deae53 commit 05cd86a

5 files changed

Lines changed: 68 additions & 43 deletions

File tree

Lines changed: 68 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
title: Can't access elements of a Java application
2+
title: Can't Access Elements of a Java Application
33
description: Troubleshoot the issue that Power Automate for desktop can't access the elements of a Java desktop application.
4-
ms.reviewer: pefelesk
5-
ms.date: 04/29/2025
4+
ms.reviewer: pefelesk, mitsirak, nimoutzo, iomimtso, v-shaywood
5+
ms.date: 11/26/2025
66
ms.custom: sap:Desktop flows\UI or browser automation
77
---
88
# Can't access the elements of a Java application
99

10-
If you encounter issues while [automating Java applications](/power-automate/desktop-flows/how-to/java) with Power Automate for desktop, follow the steps in this article to troubleshoot the issue.
10+
When [you automate Java applications](/power-automate/desktop-flows/how-to/java) by using Power Automate for desktop, you experience an issue in which Power Automate can't access the UI elements of the Java application. This article helps you troubleshoot this issue.
1111

1212
_Applies to:_   Power Automate
1313
_Original KB number:_   5014922
@@ -16,71 +16,96 @@ _Original KB number:_   5014922
1616

1717
Power Automate for desktop can't access the UI elements of a Java desktop application when you use either the [Recorder](/power-automate/desktop-flows/recording-flow) or the [Add UI element](/power-automate/desktop-flows/ui-elements) action in the flow designer.
1818

19-
## Troubleshooting steps
19+
## Diagnose using the troubleshooter
2020

21-
To solve this issue, try the [troubleshooter](/power-automate/desktop-flows/troubleshooter) first.
21+
To resolve this problem, first try the [troubleshooter](/power-automate/desktop-flows/troubleshooter):
2222

23-
1. In Power Automate for desktop, navigate to **Help** > **Troubleshooter**, and then run the [troubleshooter](/power-automate/desktop-flows/troubleshooter).
23+
1. In Power Automate for desktop, go to **Help** > **Troubleshooter**, and then run the [troubleshooter](/power-automate/desktop-flows/troubleshooter).
2424

25-
2. In the **Troubleshooter** window, select **Run** on the **Troubleshot UI/Web automation issues** panel.
25+
1. In the **Troubleshooter** window, select **Run** on the **Troubleshot UI/Web automation issues** panel.
2626

27-
3. If an issue is found for **Java Automation**, expand the panel to see the details.
27+
1. If the troubleshooter finds an issue for **Java Automation**, expand the panel to see the details.
2828

29-
4. If a **Fix** button is available, select it to apply the fix. Ensure all running **Java** applications are closed before applying the fix.
29+
1. If a **Fix** button is available, select it to apply the fix. Make sure that you close all running **Java** applications before you apply the fix.
3030

31-
If the issue persists after using the troubleshooter, follow these steps to manually troubleshoot the issue:
31+
If the problem persists after you use the troubleshooter, follow the steps in [Manual troubleshooting](#manual-troubleshooting) to further troubleshoot the issue.
3232

33-
1. Ensure that you have Java installed on your machine:
33+
## Manual troubleshooting
3434

35-
- Open the Command Line tool (cmd) and run the following command:
35+
> [!NOTE]
36+
> Use these steps only if the troubleshooter finds no Java installations or can't configure the environment.
3637
37-
```cmd
38-
java –version
39-
```
38+
### Configure Java (for Java 8 and 7)
4039

41-
- If Java isn't installed, you receive an error message:
40+
Use these steps to troubleshoot Java 8 and 7. If you're using Java 9 or a later version, see [Configure Java (for Java 9 and later)](#configure-java-for-java-9-and-later).
4241

43-
> 'java' is not recognized as an internal or external command, operable program or batch file.
42+
#### Locate the Java installation folder
4443

45-
2. Ensure that the **Enable Java Access Bridge** option is disabled in the Control Panel.
44+
1. Check common paths such as `C:\Program Files\Java\jre7` or `C:\Program Files\Java\jre8`.
45+
1. Some apps use an embedded Java runtime that isn't registered system-wide. To identify the location of an embedded Java runtime:
4646

47-
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.
47+
1. Start the Java application.
4848

49-
:::image type="content" source="media/cannot-access-java-application-elements/enable-java-access-bridge-option.png" alt-text="Screenshot of the Enable Java Access Bridge option in the Windows Control Panel." lightbox="media/cannot-access-java-application-elements/enable-java-access-bridge-option.png":::
49+
1. Open Task Manager.
5050

51-
3. Ensure that specific files exist in one or more Java folders of the machine after the Power Automate for desktop installation.
51+
1. Locate and right-click the `java.exe` process, and then select **Open file location**.
52+
53+
1. Use the selected folder as `<JRE_HOME>\bin`.
54+
55+
To avoid this issue in the future, install Java under `Program Files` or enable the option to register Java in the system registry during installation.
5256

53-
To check the installed Java version and installation path on your machine:
57+
#### Copy required files (administrator rights required)
5458

55-
1. Type _Configure Java_ in the Windows search bar.
56-
1. Open Java Control Panel and go to the **Java** tab.
57-
1. Select **View**.
59+
Copy the following files from the Power Automate for desktop installation folder (`C:\Program Files (x86)\Power Automate Desktop\dotnet\java-support`):
5860

59-
:::image type="content" source="media/cannot-access-java-application-elements/java-control-panel.png" alt-text="Screenshot of the Java Control Panel.":::
61+
- `PAD.JavaBridge.jar` to `<JRE_HOME>\lib\ext\`
62+
- `Microsoft.Flow.RPA.Desktop.UIAutomation.Java.Bridge.Native.dll` to `<JRE_HOME>\bin\` (x86 or x64 depending on the Java architecture)
6063

61-
1. 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.
64+
#### Update accessibility configuration
6265

63-
:::image type="content" source="media/cannot-access-java-application-elements/java-runtime-environments-settings.png" alt-text="Screnshot of the Java Runtime Environment Settings.":::
66+
1. Open `<JRE_HOME>\lib\accessibility.properties` in a text editor. If the file doesn't exist, create it.
67+
1. Add or update the following line:
6468

65-
Check that the following files exist:
69+
`assistive_technologies=microsoft.flows.rpa.desktop.uiautomation.JavaBridge`
6670

67-
- For 64-bit Java installation:
71+
If the line starts with the number sign (`#`), remove the `#` character to uncomment it. If other assistive technologies are listed, append the Microsoft value at the end, separated by a comma.
6872

69-
- 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.)
70-
- 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.)
71-
- If you open the file with Notepad, you should see the following value:
72-
`assistive_technologies=com.sun.java.accessibility.AccessBridge, microsoft.flows.rpa.desktop.uiautomation.JavaBridge`
73-
- 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.)
73+
> [!NOTE]
74+
> Manual file placement works for only Java 8 and 7. Java 9 and later versions don't support using this method to load assistive technologies.
7475
75-
- For 32-bit Java installation:
76+
### Configure Java (for Java 9 and later)
7677

77-
- Check the same files but in folder _C:\Program Files (x86) \Java…_.
78+
For Java 9 and later versions, you can't modify the Java installation in the same manner. Instead, use one of the following methods.
7879

79-
4. Check _.accessibility.properties_ file:
80+
#### Set environment variable (recommended)
8081

81-
- Ensure there isn't an _.accessibility.properties_ file in your _C:\Users\user_ folder. (replace _user_ with your user name.)
82-
- If the file exists, rename it.
82+
Set a system or user environment variable that's named `JDK_JAVA_OPTIONS` and has the following value (64-bit example):
8383

84-
5. Ensure that _VC_redist.x64.exe_, _VC_redist.x86.exe_, or both are run.
84+
`-javaagent:"C:\Program Files (x86)\Power Automate Desktop\dotnet\java-support\PAD.JavaBridge.jar" -Djava.library.path="%PATH%;C:\Program Files (x86)\Power Automate Desktop\dotnet\java-support\x64"`
8585

86-
:::image type="content" source="media/cannot-access-java-application-elements/installed-microsoft-visual-c-plus-plus-redistributable-versions.png" alt-text="Screenshot of the installed Microsoft Visual C++ Redistributable versions.":::
86+
For 32-bit Java, use the `x86` folder instead of the `x64` folder.
87+
88+
#### Add JVM arguments to the Java application start command
89+
90+
Append the following arguments to the app's Java startup command:
91+
92+
- `-javaagent:"<PAD install path>\dotnet\java-support\PAD.JavaBridge.jar"`
93+
- `-Djava.library.path="<PAD install path>\dotnet\java-support\x64"` (for 32-bit Java, use the `x86` folder instead of the `x64` folder)
94+
95+
## Key clarifications and troubleshooting tips
96+
97+
- Always try the Power Automate for desktop troubleshooter first. It's the safest and fastest method to configure Java automation.
98+
- Manual file placement applies only to Java 8 and 7. Use the environment-variable method or JVM-argument method for Java 9 and later.
99+
- Java versions earlier than 7 aren't supported.
100+
- The attach mechanism might not work reliably for Java 10 or Java 9.
101+
- If an application uses an embedded runtime, use Task Manager to find the Java executable path.
102+
- To be able to insert files into Java installation folders, you must have administrator rights.
103+
- If you insert the files manually, the files aren't updated automatically when Power Automate for desktop is updated. To use the latest Java automation files, repeat the manual file placement after each Power Automate for desktop update.
104+
- After you make the changes, close all running Java applications, and then restart the computer.
105+
106+
## Related content
107+
108+
- [Automate Java applications](/power-automate/desktop-flows/how-to/java)
109+
- [Power Automate troubleshooting](../../welcome-power-automate.yml)
110+
111+
[!INCLUDE [Third-party disclaimer](../../../../includes/third-party-disclaimer.md)]

0 commit comments

Comments
 (0)