Skip to content

Commit 1938049

Browse files
committed
Update java automation issues troubleshooting steps
1 parent fd61ea3 commit 1938049

1 file changed

Lines changed: 45 additions & 34 deletions

File tree

Lines changed: 45 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
---
22
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
5+
ms.author: iomimtso
6+
ms.date: 11/26/2025
67
ms.custom: sap:Desktop flows\UI or browser automation
78
---
89
# Can't access the elements of a Java application
@@ -30,57 +31,67 @@ To solve this issue, try the [troubleshooter](/power-automate/desktop-flows/trou
3031

3132
If the issue persists after using the troubleshooter, follow these steps to manually troubleshoot the issue:
3233

33-
1. Ensure that you have Java installed on your machine:
34+
## 1. Manually configure Java (only for Java 7 and 8)
3435

35-
- Open the Command Line tool (cmd) and run the following command:
36+
Use these steps only if the troubleshooter finds no Java installations or cannot configure the environment.
3637

37-
```cmd
38-
java –version
39-
```
38+
### A. Locate the Java installation folder
4039

41-
- If Java isn't installed, you receive an error message:
40+
- Check common paths such as `C:\Program Files\Java\jre7` or `C:\Program Files\Java\jre8`.
41+
- Some apps use an embedded Java runtime that is not registered system-wide. Start the Java application, open Task Manager, find the `java.exe` process, right-click it, and choose **Open file location**. Use that folder as `<JRE_HOME>\bin`.
42+
- To avoid this issue in future, install Java under `Program Files` or enable the option to register Java in the system registry during installation.
4243

43-
> 'java' is not recognized as an internal or external command, operable program or batch file.
44+
### B. Copy required files (administrator rights required)
4445

45-
2. Ensure that the **Enable Java Access Bridge** option is disabled in the Control Panel.
46+
Copy these files from the Power Automate for desktop installation folder (C:\Program Files (x86)\Power Automate Desktop\dotnet\java-support):
4647

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.
48+
- `PAD.JavaBridge.jar` to `<JRE_HOME>\lib\ext\`
49+
- `Microsoft.Flow.RPA.Desktop.UIAutomation.Java.Bridge.Native.dll` (x86 or x64 depending on the Java architecture) to `<JRE_HOME>\bin\`
4850

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":::
51+
### C. Update accessibility configuration
5052

51-
3. Ensure that specific files exist in one or more Java folders of the machine after the Power Automate for desktop installation.
53+
1. Open `<JRE_HOME>\lib\accessibility.properties` in a text editor. Create the file if it doesn't exist.
54+
2. Add or update this line:
5255

53-
To check the installed Java version and installation path on your machine:
56+
assistive_technologies=microsoft.flows.rpa.desktop.uiautomation.JavaBridge
5457

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**.
58+
If the line starts with `#`, remove the `#` to uncomment it. If other assistive technologies are listed, append the Microsoft value at the end, separated by a comma.
5859

59-
:::image type="content" source="media/cannot-access-java-application-elements/java-control-panel.png" alt-text="Screenshot of the Java Control Panel.":::
60+
Note: Manual file placement works only for Java 7 and 8. Java 9 and later do not support loading assistive technologies by this method.
6061

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.
62+
## 2. Workaround for Java 9 and later (or when file placement is not possible)
6263

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.":::
64+
For Java 9+ you cannot modify the Java installation in the same way. Use one of these options.
6465

65-
Check that the following files exist:
66+
### A. Set environment variable (recommended)
6667

67-
- For 64-bit Java installation:
68+
Set a system or user environment variable named `JDK_JAVA_OPTIONS` with this value (64-bit example):
6869

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.)
70+
`-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"`
7471

75-
- For 32-bit Java installation:
72+
For 32-bit Java, use the `x86` folder instead of `x64`.
7673

77-
- Check the same files but in folder _C:\Program Files (x86) \Java…_.
74+
### B. Add JVM arguments to the Java application start command
7875

79-
4. Check _.accessibility.properties_ file:
76+
Append these arguments to the app's Java startup command:
8077

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.
78+
- `-javaagent:"<PAD install path>\dotnet\java-support\PAD.JavaBridge.jar"`
79+
- `-Djava.library.path="<PAD install path>\dotnet\java-support\x64"` (or `x86`)
8380

84-
5. Ensure that _VC_redist.x64.exe_, _VC_redist.x86.exe_, or both are run.
81+
## Key clarifications and troubleshooting tips
8582

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.":::
83+
- Always try the Power Automate for desktop Troubleshooter first. It's the safest and fastest method to configure Java automation.
84+
- Manual file placement applies only to Java 7 and 8. Use the environment-variable or JVM-argument method for Java 9 and later.
85+
- Java versions earlier than 7 are not supported.
86+
- The attach mechanism may not work reliably with Java 9 or Java 10.
87+
- Use Task Manager to find the Java executable path when an application uses an embedded runtime.
88+
- Administrator rights are required to place files in Java installation folders.
89+
- If you placed the files manually, they are not updated automatically when Power Automate for desktop is updated. Repeat the manual file placement after each Power Automate for desktop update to use the latest Java automation files.
90+
- After making changes, close all running Java applications. Restarting the PC is recommended.
91+
92+
## More information
93+
94+
- [Automate Java applications](/power-automate/desktop-flows/desktop-flows/how-to/java)
95+
- [Troubleshoot UI automation in Power Automate for desktop](/power-automate/desktop-flows/how-to/troubleshoot-ui-automation)
96+
97+
[!INCLUDE [Third-party disclaimer](../../../../includes/third-party-disclaimer.md)]

0 commit comments

Comments
 (0)