![]() |
VOOZH | about |
dotnet add package MASES.JCOReflectorEngine --version 1.14.0
NuGet\Install-Package MASES.JCOReflectorEngine -Version 1.14.0
<PackageReference Include="MASES.JCOReflectorEngine" Version="1.14.0" />
<PackageVersion Include="MASES.JCOReflectorEngine" Version="1.14.0" />Directory.Packages.props
<PackageReference Include="MASES.JCOReflectorEngine" />Project file
paket add MASES.JCOReflectorEngine --version 1.14.0
#r "nuget: MASES.JCOReflectorEngine, 1.14.0"
#:package MASES.JCOReflectorEngine@1.14.0
#addin nuget:?package=MASES.JCOReflectorEngine&version=1.14.0Install as a Cake Addin
#tool nuget:?package=MASES.JCOReflectorEngine&version=1.14.0Install as a Cake Tool
JCOReflector is a comprehensive suite of libraries and tools to use Java/JVM APIs (Java, Scala, Kotlin, ...) and .NET side-by-side.
| .NET Framework | .NET 6 | .NET 8 |
|---|---|---|
| 👁 Maven Central |
👁 Maven Central |
👁 Maven Central |
| JCOReflectorEngine | JCOReflectorCLI |
|---|---|
| 👁 latest version 👁 downloads |
👁 latest version 👁 downloads |
👁 CI_WINDOWS
👁 CI_LINUX
👁 CI_DOCS
👁 CI_MAVEN
👁 CI_RELEASE
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.
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 . By participating, you are expected to uphold this code. Please report unacceptable behavior to coc_reporting@masesgroup.com.
JCOReflector uses JCOBridge, and its features, to obtain many benefits:
Have a look at the following resources:
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.
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(_))
Environment.Exit(0)
} catch {
case tre: Throwable =>
tre.printStackTrace()
}
}
}
the same example written in Kotlin is the following one:
package mscorlib
import system.Console
import system.Environment
object HelloIterator {
@JvmStatic
fun main(args: Array<String>) {
try {
for (drive in Environment.GetLogicalDrives()) {
Console.WriteLine(drive)
}
Environment.Exit(0)
} catch (tre: Throwable) {
tre.printStackTrace()
}
}
}
From the point of view of .NET it is very simple to use Java classes and it is not necessary to have some kind of reflection classes:
The JCOBridge is a mature platform for .NET assembly reflection, the .NET wrapper JARs are available and cover most of the .NET framework functionality.
The reflector executables, available for both Framework and CoreCLR, is limited in the following features:
C# and Java are different languages. The reflection process cannot reflects into Java some features available on C#: an example are properties where get/set is automatically choosed from C# compiler Other limitations comes from some differences between the two engines (CLR and JVM). In all cases JCOBridge superside these limitations, but manual operations shall be made: do not change the reflected classes, override them in your code.
In the root folder execute:
dotnet build JCOReflector\JCOReflector.sln
or
dotnet build JCOReflector\JCOReflectorCLI.sln
Within the folder bin you will find three subfolders:
in each subfolder will be available two executables:
The folder contains all reflected classes generated for .NET Framework (net462), 6 (net6.0) and 8 (net8.0). Below the coverage statistics:
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 net6.0 is compatible. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Framework | net462 net462 is compatible. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
Showing the top 1 NuGet packages that depend on MASES.JCOReflectorEngine:
| Package | Downloads |
|---|---|
|
MASES.NuReflector
NuReflector - a reflector engine for NuGet packages |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.16.1 | 158 | 2/12/2026 |
| 1.16.0 | 173 | 11/29/2025 |
| 1.15.0 | 304 | 12/19/2024 |
| 1.14.3 | 298 | 6/22/2024 |
| 1.14.2 | 291 | 6/18/2024 |
| 1.14.1 | 295 | 6/18/2024 |
| 1.14.0 | 308 | 5/19/2024 |
| 1.13.1 | 701 | 1/23/2024 |
| 1.13.0 | 329 | 11/26/2023 |
| 1.12.1 | 1,847 | 2/26/2023 |
| 1.12.0 | 582 | 2/8/2023 |
| 1.11.0 | 1,052 | 8/18/2022 |
| 1.10.1 | 674 | 4/6/2022 |
| 1.10.0 | 706 | 3/30/2022 |
| 1.9.3 | 675 | 3/15/2022 |
| 1.9.2 | 642 | 3/14/2022 |
| 1.9.1 | 664 | 3/11/2022 |
| 1.9.0 | 685 | 3/10/2022 |
| 1.8.6 | 674 | 3/4/2022 |
| 1.8.5 | 675 | 3/2/2022 |