java-access-bridge-wrapper is a Python wrapper for the Windows Java Access Bridge (JAB). It enables Python applications to interact with and automate Java user interfaces on the Windows operating system. This library, currently at version 2.0.0, is primarily designed for 64-bit Windows environments and Java Development Kit (JDK) or Java Runtime Environment (JRE) versions 8 or higher.
pip install java-access-bridge-wrapperVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the `JavaAccessBridgeWrapper` by setting up the necessary Windows message pump in a separate thread, which is crucial for the Java Access Bridge to receive UI events. It then attempts to list active Java windows and interact with the first detected Java application by switching to its context. It also shows an optional step to build a `ContextTree` to explore the UI elements. Before running, ensure a 64-bit Java application is open and the Java Access Bridge is enabled on your Windows system.
Ensure your Windows OS and all Java environments (JDK/JRE) are 64-bit. Target only 64-bit Java applications.
Open a command prompt as administrator, navigate to your Java `bin` directory (e.g., `C:\Program Files\Java\jre<version>\bin`), and run `jabswitch.exe -enable`. Alternatively, enable it through the Windows 'Ease of Access Center'.
Implement a background thread that continuously calls Windows API functions like `GetMessageW`, `TranslateMessage`, and `DispatchMessageW` to pump messages. Initialize `JavaAccessBridgeWrapper` within this same thread. The quickstart example demonstrates this pattern.
Set the environment variable `RC_JAVA_ACCESS_BRIDGE_DLL` to the absolute path of `WindowsAccessBridge-64.dll` (e.g., `C:\Program Files\Java\jre<version>\bin\WindowsAccessBridge-64.dll`). Alternatively, pass the path directly via the `access_bridge_path` parameter during `JavaAccessBridgeWrapper` initialization.
For applications with many elements, consider alternative strategies or specific options if provided by higher-level frameworks using this wrapper. If `setTextContents` fails for older JREs (e.g., 1.3.x), send keystrokes instead.
No dependency data recorded yet.