SkillAgentSearch skills...

JCOReflector

.NET wrapper generator for Java™ — reflects any .NET assembly into JARs, enabling Java/Scala/Kotlin/... applications to call .NET APIs directly

Install / Use

/learn @masesgroup/JCOReflector

README

JCOReflector (a .NET Java™ wrapper)

Java 8+ .NET 8+

JCOReflector is a comprehensive suite of libraries and tools to use Java™/JVM™ APIs (Java, Scala, Kotlin, ...) and .NET side-by-side.

Libraries and Tools

|.NET Framework | .NET 8 | .NET 9 | .NET 10 | |:---: |:---: |:---: |:---: | |Maven Central | Maven Central| Maven Central| Maven Central|

|JCOReflectorEngine | JCOReflectorCLI | |:---: |:---: | |latest version downloads|latest version downloads|

Pipelines

CI_REFLECT_TEST_COMMIT CI_DOCS CI_MAVEN CI_RELEASE

Project disclaimer

JCOReflector is a project, curated by MASES Group, can be supported by the open-source community.

Its primary scope is to support other, public or internal, MASES Group projects: open-source community and commercial entities can use it for their needs and support this project, moreover there are dedicated community and commercial subscription plans.

The repository code and releases may contain bugs, the release cycle depends from critical discovered issues and/or enhancement requested from this or other projects.

Looking for the help of experts? MASES Group can help you design, build, deploy, and manage applications mixing .NET and JVM™ enabled languages.


The project

JCOReflectorEngine produces a set of .NET wrapper for Java™ as JARs that are available for download. It's simple to use: you only need to reference JCOReflector.jar in the class-path and use the .NET API within your Java™ projects like exposed in the example section.

The core of the project is the innovative JCOReflector, a reflection engine which automatically writes Java™ classes using .NET class reflection. JCOReflector can be used to reflects any .NET assembly (even assembly outside the Microsoft ones) into JARs. The generated wrapper classes are based on the powerful JCOBridge engine and extends its use to simplify the use of .NET from Java™(JVM™). It was created internally from us to support our customers, now we made it available for everyone.

This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to coc_reporting@masesgroup.com.

Why JCOReflector?

Access .NET from Any Java Version (8 through 25)

JCOReflector enables Java applications—including legacy Java 8 systems—to call .NET libraries and frameworks directly:

// Java 8 application calling .NET
import system.Console;
import microsoft.ml.*;

public class LegacyApp {
    public static void main(String[] args) {
        // Call .NET ML.NET from Java 8!
        var mlContext = new MLContext();
        var prediction = model.predict(data);
        
        Console.WriteLine("Prediction: " + prediction);
    }
}

Key Benefits:

  • Java 8+ Compatible - Works with Java 8 through Java 25
  • No .NET Code Changes - Generated wrappers for any .NET assembly
  • Legacy Modernization - Add ML.NET, Azure SDKs to Java 8 apps
  • Gradual Migration - Keep Java 8, modernize capabilities

Use Case: Call modern .NET libraries (ML.NET, Azure SDK, etc.) from existing Java 8 applications without upgrading Java runtime.

Runtime engine

JCOReflector uses JCOBridge, and its features, to obtain many benefits:

  • Cyber-security:
    • JVM™ and CLR, or CoreCLR, runs in the same process, but are insulated from each other;
    • JCOBridge does not make any code injection into CLR or JVM™;
    • JCOBridge does not use any other communication mechanism than JNI;
    • JVM™ inherently inherits the cyber-security levels of running .NET (CLR);
  • Direct access the CLR from any JVM™ application:
    • No need to learn new APIs: we try to expose the same .NET APIs in Java™ style;
    • No extra validation cycle: bug fix, improvements, new features are immediately available;
    • Documentation is shared.

JCOBridge 2.6.* can be used for free without any obligations; you need to purchase a commercial license, or uninstall the software, if you have direct or indirect incomes from the product usage.

Supported Versions

Java:

  • ✅ Java 8 (JRE 1.8.0_161 or later)
  • ✅ Java 11 (LTS)
  • ✅ Java 17 (LTS)
  • ✅ Java 21 (LTS)
  • ✅ Java 25 (LTS)

Note: Works with Oracle JDK, OpenJDK, Amazon Corretto, Azul Zulu, and other compatible distributions.

.NET:

  • .NET Framework 4.6.2+
  • .NET 6, 8, 9, 10

Note for Java 8 Users: JCOReflector enables modernization of Java 8 applications by providing access to cutting-edge .NET libraries without requiring Java runtime upgrades. Oracle Extended Support for Java 8 runs until December 2030.

JCOBridge resources

Have a look at the following JCOBridge resources:

|JCOBridge | 2.5.* series | 2.6.* series | |:---: |:---: |:---: | |JCOReflector | > 1.12.* series | > 1.16.* series | |Release notes|Link| Link| |Community Edition|Conditions|Conditions| |Commercial Edition|Information|Information|

Latest release: JCOBridge nuget

History of the project

This project started in 2019 with the aims to create a set of Java™ (JVM™) classes which mimic .NET (Framework/6/8) conterparts, in May 2020 the first commit in GitHub. Using this project it is possible to use .NET API in Java™ and all JVM™ enabled languages (Scala, Kotlin, and so on). The final output of JCOReflector are JARs. At its first stages no JARs was available: only the JCOBridge engine, the graphical UI that helps to manages reflection and the operations needed to finally build JARs was relased. Starting from recent relases automated continous integration and verification process are in places, so the produced JARs are directly available for download and is no more needed to manually rebuils JARs before use it. Anyway still possible to use JCOReflector to reflects any .NET assembly (even assembly outside the Microsoft ones) into JARs, and because JCOReflector uses templates it is not necessary to manually manages the output, special needs can be addressed dirctly inside the templates.

Simple example


package mscorlib;

import system.*;
import system.io.*;

public class HelloNET {
    public static void main(String[] args) {
        try {
            String filename = "test.txt";
            String result = "";
            if (File.Exists(filename)) {
                result = File.ReadAllText(filename);
				Console.WriteLine(result);
                result = result + "Java Execution ";
                File.WriteAllText(filename, result);
            }
            Console.WriteLine(result);
            Console.WriteLine("Exiting");
        } catch (FileNotFoundException fnfe) {
            fnfe.printStackTrace();
        } catch (Throwable tre) {
            tre.printStackTrace();
        }
        return;
    }
}

This is the result:

prompt> This is a text file for read/write operation
prompt> This is a text file for read/write operation Java Execution
prompt> Exiting

To run it runs a command like the following one:

java -cp JCOReflector.jar;. HelloNET

The full example code, and other ones, are in the project test folder.

A basic Scala examples is the following one:

package mscorlib

import system.Console
import system.Environment

object HelloIterator {
  def main(args: scala.Array[String]): Unit = {
    try {
      Environment.GetLogicalDrives.foreach(Console.WriteLine(_))
      Environm
View on GitHub
GitHub Stars63
CategoryDevelopment
Updated3d ago
Forks6

Languages

Java

Security Score

100/100

Audited on Mar 30, 2026

No findings