How do I enable the Java Access Bridge in a bundled JRE?

6k Views Asked by At

In Java 1.7, the Java Access Bridge is bundled from start. It says that all you need to do is to run jabswitch.exe -enable to enable the JAB for this particular JRE.

This works fine when you get your JRE from the installer. However, when deploying a Java application for Windows only, you may want to bundle a JRE for easier installation. When the JRE is bundled, it seems impossible to activate the Java Access Bridge

Is there a way to enable the Java Access Bridge in a bundled JRE?

3

There are 3 best solutions below

0
On

You need to do three steps (describing for configuration: Windows 7 64 bits, private JRE 8 64 bits, and JAWS 14):

  1. Copy \jre\bin\WindowsAccessBridge-64.dll to C:\Windows\System32 as documented at Oracle site: http://docs.oracle.com/javase/7/docs/technotes/guides/access/enable_and_test.html
  2. (Undocumented) Import the following registry file:

    Windows Registry Editor Version 5.00
    
    [HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Accessibility]
    "Configuration"=",oracle_javaaccessbridge"
    
  3. (Undocumented) Add JRE binaries location to user's PATH environment variable (e.g. C:\mydir\jre\bin)

Make sure you have uncommented lines in accessibility.properties:

assistive_technologies=com.sun.java.accessibility.AccessBridge
screen_magnifier_present=true

Also, start JAWS before your Java application.

0
On

I think the command line switch takes a / not a -

e.g. jabswitch.exe /enable

here is the command line help

jabswitch.exe /help

jabswitch [/enable | /disable | /version | /?]

Description:
  jabswitch enables or disables the Java Access Bridge.

Parameters:
  /enable   Enable the Java Accessibility Bridge.
  /disable  Disable the Java Accessibility Bridge.
  /version  Display the version.
  /?        Display this usage information.

Note:
  The Java Access Bridge can also be enabled with the
  Windows Ease of Access control panel (which can be
  activated by pressing Windows + U).  The Ease of Access
  control panel has a Java Access Bridge checkbox.  Please
  be aware that unchecking the checkbox has no effect and
  in order to disable the Java Access Bridge you must run
  jabswitch.exe from the command line.

Also with respect to JAWS, try to get Java7 update 60, which comes with JAB 2.0.4, as this version fixes a bug with JAWS.

0
On

Doing jabswitch.exe /enable only changes some global parameter which is not identical for different versions of Java. In my case, it enabled Java 8 but not Java 7.

As it turns out, at least in Windows 10/11, it suffices to simply uncomment two lines in accessibility.properties in the subdir lib of each bundled JRE:

assistive_technologies=com.sun.java.accessibility.AccessBridge
screen_magnifier_present=true

Note: According to Microsoft it may additionally be necessary to disable the global switch: Enter in the Start menu "Optimize visual display" and then on the very bottom check off Java Access Bridge. In my case it worked irrespective of the global setting, so I assume the accessibility.properties takes precedence.