Note:
For Java 9+, the UiPath Extension for Java works on Windows Enterprise and non-Enterprise editions with applications opened with Java JDK. For applications opened with Java JRE, the UiPath Extension for Java only works on non-Enterprise Windows editions. Read more on the Java Extension Troubleshooting guide.
Installing the Extension for Java
From Studio and the Command Line
The UiPath Extension for Java is installed by doing the following:
- First, close any running Java applications. Launch Studio and access the Tools tab from the Studio Backstage view. The extensions you can install become visible. Click the Java Extensions button. A confirmation message appears, informing you that the extension has been installed.
- Run this command
C:\Program Files (x86)\UiPath\Studio\UiPath\SetupExtensions.exe /Java
in a command prompt window with administrator rights.
Studio and UI Explorer also ask to install the UiPath Extension for Java when you try to select a control inside a Java app and when the bridge is not detected. Please note that if you choose to install the UiPath Extension for Java when prompted by UI Explorer the Java Bridge files get deployed only in the JRE directory which launched the target Java application instead of the JDK directory.
Note:
To install this extension you must have administrator rights.
To check if the extension is not working properly, open UIExplorer and try to select controls inside a Java app. If the entire window is selected, it means that the extension is not working properly.
You can tell whether or not the extension is properly installed by the generated selectors for Java controls.
<wnd app=”...” /><java role=”...” />
<wnd app=”...” /><ctrl role=”client” />
Note:
The UiPath Extension for Java is compatible only with AWT apps (e.g. Java Swing, Oracle Forms, Fujitsu JBK), while SWT apps are automated with Active Accessibility. To detect the type of your Java application, check the
cls
attribute (window class name) in UI Explorer. The class name should be similar toSunAwtFrame
orjavax.swing
.
Processes can interact with Java applications regardless of their DPI scaling.
The UiPath Extension for Java can also be installed using the ScreenScrapeJavaSupport tool.
Installing the Extension in a Custom Folder
For Java 8 or Lower
In order to have the UiPath Extension for Java installed in a custom location, the following steps need to be performed:
- Create a new folder on your machine in which you wish to install the UiPath Extension for Java (such as
C:\UiPathJavaExt
) and copy the following files to it:
1.1.UiPathBridge.jar
- located in the%UserProfile%\.nuget\packages\uipath\20.xx.xxxx\build\UiPath\JavaSupport
directory.
1.2.UiPathJavaBridgeV8.dll
andUiPathJavaBridgeV8_x64.dll
located in the%UserProfile%\.nuget\packages\uipath\20.xx.xxxx\build\UiPath
directory. It is not necessary to copy both files, but it can prevent issues which can occur due to version mismatch between the JRE and the UiPathJavaBridge. - The Java Extension Setup mechanism used by UiPath to install the extension deploys the
UiPathBridge.jar
andaccessibility.properties
files in the Java installation directory (usuallyC:\Program Files (x86)\Java\jre1.8.0_xx
). To use the UiPath Extension for Java from a custom folder, the dependency for these files must be loosened, as follows:
2.1. For theUiPathBridge.jar
file, you need to specify the folder in which you copied theUiPathBridge.jar
andUiPathJavaBridgev8.dll
(such asC:\UiPathJavaExt
) when you start the Java application which uses the extension. This is done through the-Djava.ext.dirs = C:\UiPathJavaExt
argument.
2.2. For theaccessibility.properties
file, there are two methods:- Add the
assistive_technologies=UiPath.UiPathBridge
parameter to theaccessibility.properties
global configuration file located in the%userprofile%
directory. Please note that this file is different from the one deployed by the UiPath Extension for Java, and its settings have precedence over the ones set by the Java installation. - Use the
-Djavax.accessibility.assistive_technologies=UiPath.UiPathBridge
argument when you run the target Java application.
- Add the
System properties need to be properly passed to the target Java application. This can be done through several methods:
- Include the
-Djava.ext.dirs=C:\UiPathJavaExt -Djavax.accessibility.assistive_technologies=UiPath.UiPathBridge
system property in the_JAVA_OPTIONS
environment variable. The JRE loads the properties from the environment variable and the UiPath Extension for Java loaded in the target application. - Use the
C:\Program Files (x86)\Java\jre1.8.0_xx\bin\java.exe -Djavax.ext.dirs=C:\UiPathJavaExt -Djavax.accessibility.assistive_technologies=UiPath.UiPathBridge -jar SwingSet2.jar
command inside command prompt. A confirmation message appears that the UiPath Extension for Java is successfully loaded. - Include the
-Djava.ext.dirs=C:\UiPathJavaExt -Djavax.accessibility.assistive_technologies=UiPath.UiPathBridge
system property in theJAVA_TOOL_OPTIONS
environment variable. Please note that this method only works with Java 5 or greater.
Passing the properties to a Java applet is done with one of the following methods:
- Using the
appletviewer.exe
application.
This method requires you to first create the .java.policy
file in the %userprofile%
folder, and should contain the following:
grant {
permission java.net.URLPermission "url_of_the_Java_applet", "*:*";
};
Once this is done, the target applet needs to be started via appletviewer.exe
with this command:
C:\Program Files (x86)\Java\jre1.8.0_xx\bin\appletviewer.exe -J-Djava.ext.dirs=C:\UiPathJavaExt -J-Djavax.accessibility.assistive_technologies=UiPath.UiPathBridge url_of_the_java_applet
- Using the Java Control Panel which is delivered with the JRE.
The Java Control Panel allows you to specify the runtime parameters for each registered JRE. As such, you need to specify the following parameter for the target applet: -Djava.ext.dirs=C:\UiPathJavaExt -Djavax.accessibility.assistive_technologies=UiPath.UiPathBridge
. This makes the UiPath Extension for Java load every time the Java applet starts.
The table below present the compatibility between the methods used above, Java versions, and different types of Java applications:
Application Type | _JAVA_OPTIONS | JAVA_TOOL_OPTIONS | Command Line Parameters | Java Control Panel - Runtime Parameters |
---|---|---|---|---|
Java Desktop Application | Java 3 to Java 8 | Java 5 to Java 8 | Java 3 to Java 8 | Not Supported |
Java Contained Application (.exe ) | Java 3 to Java 8 | Java 5 to Java 8 | Java 3 to Java 8 (1 ) | Not Supported |
Java Applet | Java 3 to Java 8 | Java 5 to Java 8 | Not Supported | Java 3 to Java 8 |
Java Oracle Forms | Not Supported | Not Supported | Not Supported | Not Supported |
(1
) - Depending on the command line tool you use, additional parameters might need to be passed through the environment variables.
For Java 9 or Greater
Starting with Java 9, the Java Extension Mechanism is removed, which means that the -Djava.ext.dirs
argument can not be used on Java 9 and greater applications. As such, the following steps need to be performed:
- Create a new folder on your machine in which you wish to install the UiPath Extension for Java (such as
C:\UiPathJavaExt
) and copy the following files to it:
1.1.UiPathBridge.jar
andUiPathJavaServiceProvider.jar
- located in the%UserProfile%\.nuget\packages\uipath\20.xx.xxxx\build\UiPath\JavaSupport
directory.
1.2.UiPathJavaBridgeV8.dll
andUiPathJavaBridgeV8_x64.dll
located in the%UserProfile%\.nuget\packages\uipath\20.xx.xxxx\build\UiPath
directory. It is not necessary to copy both files, but it can prevent issues which can occur due to version mismatch between the JRE and the UiPath Java Bridge. - Add the previously created folder to the class path of the target Java application. This is done with the
-cp, -classpath
command. For the sake of our example, we consider SwingSet2 the target Java application:
C:\Program Files (x86)\Java\jre1.9.0_xx \bin\java.exe -cp SwingSet2.jar; C:\UiPathJavaExt -Djavax.accessibility.assistive_technologies=UiPathJavaServiceProvider SwingSet2
Troubleshoot
This topic presents the most frequent reasons for which the UiPath Extension for Java might not work properly, and how to solve these issues.
To check if the extension is not working properly, open UIExplorer and try to select controls inside a Java app. If the entire window is selected, it means that the extension is not working properly.
If you can select controls, but their selectors look like
<wnd app=”...” /><ctrl role=”client” />
instead of <wnd app=”...” /><java role=”...” />
, then the extension is not working properly.
Please note that the UiPath Extension for Java is compatible only with AWT apps (e.g. Java Swing, Oracle Forms, Fujitsu JBK), while SWT apps are automated with Active Accessibility. To detect the type of your Java application, check the cls
attribute (window class name) in UiExplorer. The class name should be similar to SunAwtFrame
or javax.swing
.
Note:
For Java 9+, the UiPath Extension for Java works on Windows Enterprise and non-Enterprise editions with applications opened with Java JDK. For applications opened with Java JRE, the UiPath Extension for Java only works on non-Enterprise Windows editions.
Using Java 9+ JRE applications:
Prior to Java 9, the Java Runtime Environment (JRE) included the jdk.attach
module, which interacted with the UiPath Extension Java to generate appropriate selectors. Java 9+ only includes this module in the Java Development Kit (JDK).
Selectors are generated for any Java 9+ application opened with Java JDK. If, however, you need to create automation projects which interact with applications opened with Java JRE, you need to manually include the jdk.attach
module in the target JRE.
To prevent possible issues:
- Open Process Explorer.
- In the View menu, select Lower Pane View > DLLS, or press Ctrl+D. A panel is displayed in the lower part of the window.
- Select the process of your Java app and check if
UiPathJavaBridgeV8.dll
orUiPathJavaBridgeV8_x64.dll
are loaded by your Java app. - Check from what path the
java.dll
module is loaded. A regular JRE has a path likeC:\Program Files (x86)\Java\jre1.8.0_xx\bin\java.dll
. A custom JRE is usually located in the application folder.
You can also verify if the extension files have been properly installed:
- Using a text editor, such as Notepad++, open the
accessibility.properties
file, which is located in theC:\Program Files (x86)\Java\jre1.8.0_xx\lib
folder. If the extension is properly installed, the file should containassistive_technologies=UiPath.UiPathBridge
. - In the
C:\Program Files (x86)\Java\jre1.8.0_xx\lib\ext
folder, you should find theUiPathBridge.jar
file. - In the
C:\Program Files (x86)\Java\jre1.8.0_xx\bin
folder, you should findUiPathJavaBridgeV8.dll
orUiPathJavaBridgeV8_x64.dll
.
Note:
If any of the previous requirements are not met, you can try to reinstall the extension as explained above, or fix them manually.
Disabling the Java Access Bridge:
Having Java Access Bridge enabled creates the accessibility.properties
file in the current user's home directory which overwrites the accessibility bridge loaded by the default bridge. The solution is to disable the Java Access Bridge and remove the accessibility.properties
file, as follows:
- Go to Control Panel > Ease of Access Center > Make the computer easier to see.
- Scroll to the bottom of the page to the Other programs installed section.
- Make sure the Enable Java Access Bridge box is not selected.

- If the Enable Java Access Bridge box was checked go to
C:\Users\current_user
. - Delete the
.accessibility.properties
file.
Note:
If the Enable Java Access Bridge option is not visible, you need to reinstall or update Java.
Running UiPath Studio 2017.1 without SP1
Some Java web applications do not load properly when using UiPath Studio 2017.1 or lower. This occurs with JInitiator 1.3 and JRE 3. To prevent this you need to manually copy the xml-apis.jar
file to the C:\Program Files (x86)\Java\jre1.8.0_xx\lib\ext
folder or C:\Program Files (x86)\Java\JInitiator1.3.18\lib\ext
folder.
Note:
This issue only occurs in Studio versions lower than 2017.1 SP1.
If the above information did not solve your issue, you can try getting additional information by viewing traces as explained here, and analyzing the errors thrown by the UiPath extension.
Updated 2 years ago