# Java Access Bridge

**Description:**  
Java Access Bridge is a technology that exposes the Java Accessibility API in a Microsoft Windows DLL, enabling Java applications and applets that implement the Java Accessibility API to be visible to assistive technologies on Microsoft Windows systems.

In order for existing assistive technologies available on Microsoft Windows systems to provide access to Java applications, they need some way to communicate with Java Accessibility Utilities. Java Access Bridge supports this communication.

## Enabling Java Access Bridge
In Windows Vista and later, one can enable Java Access Bridge through the Control Panel:

_Go to Start > Control Panel > Ease of Access > Ease of Access Center_. Alternatively, press Windows logo _key+u_ to access the Ease of Access Center.

Select Use the computer without a display.

In the section, Other programs installed, select the check box Enable Java Access Bridge (one may have to scroll down).

**Note:** After enabling Java Access Bridge, one must restart their assistive technology software and Java applications that use the accessibility API.

## Installation
If you have installed only one JDK/JRE version 7 or higher, Leapwork Studio tunes your Java Access Bridge automatically during installation.

If you have few installed versions of Java, Leapwork studio tunes only the default Java Access Bridge on your machine.

To find out the default JDK/JRE version on your machine, perform the next steps:

1. Look at a list of all System Variables and detail information about the Path variable like on the screenshots:

2. If you have the JAVA_HOME variable in your list of variables then this is your default path to JDK/JRE (Figure 1), if you don’t – your default path will be in the Path variable.

## Troubleshooting
1. If you have Java 6 on your machine and other versions of Java before you install Leapwork studio you need to ensure that your JAVA_HOME path contains a path to Java 6 because if you don’t, you should install Java Access Bridge manually:
   - All needed Java Access Bridge files to lie in our installed directory _C:/Program Files/Leapwork/Studio/JavaAccessBridge_, you need just copy these files to the specified destination directories ([official documentation](https://docs.oracle.com/javase/accessbridge/2.0.2/setup.htm#jab-installing-java-access-bridge)):  
     1. For _Java 6 x86_ version on **64-bit** Windows:
        1. **JavaAccessBridge-32.dll** and **JAWTAccessBridge-32.dll** to:
           _C:\Program Files (x86)\Java\jdk1.6.0_45\jre\bin_
           _C:\Program Files (x86)\Java\jre6\bin_
        2. **accessibility.properties** to:
           _C:\Program Files (x86)\Java\jdk1.6.0_45\jre\lib_
           _C:\Program Files (x86)\Java\jre6\lib_
        3. **access-bridge-32.jar** and **jaccess.jar** to:
           _C:\Program Files (x86)\Java\jdk1.6.0_45\jre\lib\ext_
           _C:\Program Files (x86)\Java\jre6\lib\ext_
     2. For _Java 6 x64_ version on **64-bit** Windows:
        1. **JavaAccessBridge-64.dll** and **JAWTAccessBridge-64.dll** to:
           _C:\Program Files\Java\jdk1.6.0_45\jre\bin_
           _C:\Program Files\Java\jre6\bin_
        2. **accessibility.properties** to:
           _C:\Program Files\Java\jdk1.6.0_45\jre\lib_
           _C:\Program Files\Java\jre6\lib_
        3. **access-bridge-64.jar** and **jaccess.jar** to:
           _C:\Program Files\Java\jdk1.6.0_45\jre\lib\ext_
           _C:\Program Files\Java\jre6\lib\ext_
     3. For _Java 6 x86_ version on **32-bit** Windows:
        1. **JavaAccessBridge.dll** and **JAWTAccessBridge.dll** to:
           _C:\Program Files\Java\jdk1.6.0_45\jre\bin_
           _C:\Program Files\Java\jre6\bin_
        2. **accessibility.properties** to:
           _C:\Program Files\Java\jdk1.6.0_45\jre\lib_
           _C:\Program Files\Java\jre6\lib_
        3. **access-bridge.jar** and **jaccess.jar** to:
           _C:\Program Files\Java\jdk1.6.0_45\jre\lib\ext_
           _C:\Program Files\Java\jre6\lib\ext_
2. How to ensure that your Java Access Bridge is enabled?
   1. Download [Java Access Bridge](https://www.oracle.com/technetwork/java/javase/downloads/jab-2-0-2-download-354311.html) 2.0.2 from the official Oracle web-page;
   2. Start your java based application
   3. start _Java-Monkey.exe_ version depending on your operating system and Java bit level, e.g. for Java 6 x86 on Windows 64-bit you should start _Java-Monkey-32.exe_
   4. Press _File -> Refresh Tree._ **Java-Monkey** will show you a tree of accessible elements
     
3. Automation Studio is unable to load anything and an hourglass cursor keeps on blinking
   This issue occurs when the machine installed a few versions of Java. To understand which one of the Java versions starts certain Java application you need:
   1. Start your Java application, open the Task Manager, add a **Command-line** column by right-clicking on a mouse, like on the picture as follows:
   
   2. Look at the _full path of the started Java application_ like in the example as follows:
   
      _3. C:\Program Files\Java\jre1.8.0_201 - the path to your JDK/JRE. If it is Java 6 or lower, you need to ensure that what in JDK/JRE folder lie Java Access Bridge files like in _Troubleshooting 1_ question.

If JDK/JRE version 7 or higher you can try to enable Java Bridge manually:
 1. Start **Command prompt (aka cmd)**:
   
 2. Execute the next command : _"C:\Program Files\Java\jre1.8.0_201\bin\jabswitch.exe" -enable_

Where _C:\Program Files\Java\jre1.8.0_201_– the path to JDK/JRE.

For any clarification, please contact our [Priority Support](mailto:prioritysupport@leapwork.com).
