Features
In-process, type-safe and production-proven integration between .NET and the JVM. Current release: JCOBridge 2.6.10.
How it works
JCOBridge uses pure JNI for two-way communication between .NET and the JVM. Both runtimes live in the same process and run native code at full speed. Objects stay in their own runtime, so nothing is serialized, no network is involved, and what crosses the boundary is a reference rather than a copy.
| Approach | Performance | Complexity | Security |
|---|---|---|---|
| JCOBridge (JNI) | Native | Low | No attack surface |
| REST APIs | 10-100x slower | Medium | Network exposed |
| gRPC | 3-10x slower | Medium | Network exposed |
| Custom channels | Varies | High | Attack surface |
Performance
JCOBridge 2.6.10 is benchmarked on every release across the supported .NET and JDK versions on GitHub Actions runners. Values are medians across the CI matrix for each CPU class. They come from shared hosted runners, so read them comparatively.
Calls, fields and object creation (JVM from .NET)
| Benchmark | arm64 | x64 AVX2 | x64 AVX-512 |
|---|---|---|---|
| Static method, no arguments | 150 ns | 147 ns | 78 ns |
| Static method, with feedback ¹ | 513 ns | 540 ns | 273 ns |
| Object creation | 796 ns | 900 ns | 518 ns |
| Get instance int field | 66 ns | 74 ns | 37 ns |
| Set instance int field | 95 ns | 83 ns | 43 ns |
| Get instance String field | 84 ns | 73 ns | 39 ns |
| Set instance String field | 537 ns | 581 ns | 309 ns |
¹ The method takes and returns a boolean, instead of being a no-argument void method.
Callbacks from the JVM to .NET
The JVM fires 1,000,000 callbacks toward .NET without returning control, the realistic case for event-driven workloads.
| Sustained callback | arm64 | x64 AVX2 | x64 AVX-512 |
|---|---|---|---|
| Discard at the first gate | 45 ns | 34 ns | 37 ns |
| Full processing | 2.60 µs | 3.07 µs | 1.78 µs |
The two-level ListenerShallManageEvent filter drops unwanted events early: at the first gate before any data is read (about 25-45 ns), or at the second gate once the raw data is available (about 130-250 ns). On high-rate sources that is the difference between paying for a full callback and paying almost nothing.
Note
New in 2.6.10: events identified by numeric index (byIndex = true) and by string key (byIndex = false) now perform practically the same. The index is resolved once and used as a hashmap key, so you can choose the more readable option at no cost.
Bulk data transfer
Since 2.6.9, JCOBridgeStream<T> (JVM arrays) and JCOBridgeDirectBuffer<T> (JVM DirectByteBuffer) expose ReadOnlySpan<T> and ToStream() for any unmanaged T.
- DirectByteBuffer with AsSpan: zero-copy from native memory in every edition, about 16 GB/s at 100 MB.
- JVM arrays with AsSpan in the HPA Edition: direct access to JVM array memory with no copy. With
forceRawMemory=true, latency drops by up to 88% against the Standard edition on large arrays, for example 100 KB: 80 µs to 9 µs on .NET 10. - Small arrays up to 100 KB: the optimized path in the Standard edition keeps per-call overhead around 1-2 µs.
Performance tips
- Prefer
InvokeWithSignatureoverInvokein hot paths on x86: it skips .NET-side type matching. - Primitive fields are cheap, String writes are not: a String field write costs about 7 times the read.
- Avoid large
String[]arrays in hot paths, since each element is marshalled individually. Prefer primitive arrays orJCOBridgeStream<T>. - Keep argument lists short on frequently called methods.
- Use the two-level
ListenerShallManageEventfilter on high-rate event sources.
Sustained high-frequency workloads
At high callback rates the main concern is GC pressure on cross-boundary references, not raw per-call latency. The HPA Edition keeps those references rooted whatever the GC does on either side, and adds true zero-copy array access. Technical details
Full data: performance page, results by CPU model, latest results and the live dashboard.
Java 8 to 25
| Java version | Released | Status |
|---|---|---|
| Java 8 (LTS) | 2014 | Supported |
| Java 11 (LTS) | 2018 | Supported |
| Java 17 (LTS) | 2021 | Supported |
| Java 21 (LTS) | 2023 | Supported |
| Java 25 (LTS) | 2025 | Supported |
Oracle offers Java 8 Extended Support until December 2030, and Amazon Corretto and Azul Zulu provide long-term updates for free.
Newer JVMs run older bytecode. Start a Java 17 JVM and your Java 8 libraries work unchanged, next to Java 11 and 17 code in the same process. See the Java 8 integration guide.
Secure because there is no network
- No network ports opened
- No external attack surface
- Memory isolation between the runtimes
- Standard OS process security applies
- No custom protocol to secure
Network integration adds exposed ports and firewall rules, authentication and encryption to configure, and exposure to port scanning, man-in-the-middle and DoS. With no traffic between components, PCI-DSS, HIPAA and SOC 2 reviews have less to cover.
API coverage
Call .NET from Java
- Load any .NET assembly and use all public types, including generics, nested types and inner classes
- Instance and static methods, properties, fields, indexers, constructors
- Delegates and events, extension methods, nullable reference types
- WPF and WinForms controls inside AWT/Swing
Call Java from .NET
- Load any JAR and use all public classes, including generics, inner and anonymous classes
- Instance and static methods, fields, constructors including varargs, overloading
- Lambdas, the Streams API, exceptions, reflection, C#
dynamic - Zero-copy bulk data with
JCOBridgeStream<T>andJCOBridgeDirectBuffer<T> - Swing, AWT and SWT inside WPF and WinForms
See the .NET examples and the Java examples.
Platform support
| Windows | All client and server versions supported by the .NET and Java runtimes |
| Linux and macOS | Linux (Ubuntu, RHEL, CentOS, Debian) and macOS |
| CPU architectures | x64 and arm64 |
| .NET | .NET Framework 4.6.2+, .NET 10 and .NET 11. Versions follow the Microsoft deprecation policy, others on request |
| Java | 8 (JRE 1.8.0_161+), 11, 17, 21 and 25 |
| JVM distributions | Oracle JDK, OpenJDK, Amazon Corretto, Azul Zulu, Eclipse Temurin, Red Hat OpenJDK, IBM Semeru Runtime and other OpenJDK-based builds |
Where it is used
- Legacy integration: connect Java 8 banking or payment systems to modern .NET cloud applications without a migration.
- Industrial automation: bridge Java MES and SCADA systems with .NET analytics and Azure IoT platforms.
- AI and ML: use ML.NET models from Java applications, or Java ML libraries from .NET.
The footprint is small, about 10-20 MB of runtime overhead and under 5 MB of assemblies and JARs, which suits IoT gateways, industrial controllers and edge devices. JCOBridge is built on the field-proven DLR plugin of the Sinapse platform.
Try it on your own code
The Community Edition is free for development. Commercial licenses cover production use.