MASES.JCOBridge 2.4.14

.NET 5.0 .NET Core 3.1 .NET Framework 4.6.1
dotnet add package MASES.JCOBridge --version 2.4.14
NuGet\Install-Package MASES.JCOBridge -Version 2.4.14
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MASES.JCOBridge" Version="2.4.14" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MASES.JCOBridge --version 2.4.14
#r "nuget: MASES.JCOBridge, 2.4.14"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install MASES.JCOBridge as a Cake Addin
#addin nuget:?package=MASES.JCOBridge&version=2.4.14

// Install MASES.JCOBridge as a Cake Tool
#tool nuget:?package=MASES.JCOBridge&version=2.4.14

JCOBridge main features

Field proven Built on top of the field proven DLR plugin available in the Sinapse platform (https://www.sinapsesystem.com), JCOBridge guarantees the best performance in JVM and CLR worlds integration.

CLR : Available for .NET Framework for Windows on www.jcobridge.com, .NET Core, .NET 5 and .NET 6 on x86/x64/Arm/Arm64, Linux x64/Arm/Arm64 (other platforms/architectures available on demand)

  • Retrieve JVM class
  • Instantiate JVM objects
  • Invoke static methods
  • Invoke instance methods
  • Get/Set static fields
  • Get/Set instance fields
  • Use dynamic access to write code in a seamless way as it is done in Java language
  • Use specific interface to direct manages methods and fields
  • Support classes to simplify bridging of Java classes from .NET
  • .NET side is able to send back data to the JVM upon events
  • Events can now manage more than one information
  • Exceptions directly managed from the core
  • User interface Controls, properties and events management
  • Integrates Java UI (AWT/Swing/SWT) into WPF/WinForms (from version 2.2)

JVM : Available for .NET Framework on www.jcobridge.com, .NET Core, .NET 5 and .NET 6 on Windows x86/x64/Arm/Arm64, Linux x64/Arm/Arm64 (other platforms/architectures available on demand)

  • Retrieve CLR Type
  • Instantiate CLR object
  • Invoke static methods
  • Invoke instance methods
  • Get/Set static properties
  • Get/Set instance properties
  • Set Delegates
  • Subscribe/Unsubscribe events
  • Integrates WPF controls into AWT/Swing window (experimental on .NET Core, use the version on Windows in production)
  • Integrate WinForms controls into AWT/Swing window (experimental on .NET Core, use the version on Windows in production)
  • Integrate complex .NET Graphical user interfaces objects into AWT/Swing window (experimental on .NET Core, use the version on Windows in production)
  • User interface Controls, properties and events management (experimental on .NET Core, use the version on Windows in production)

JCOBridge Coding simple example

Imagine you have the following Java Class:

public class MyJavaClass 
{
    //Static member
    static public String myStaticJavaHelloWorld()
    {
        return "Hello Static World from Java!!";
    }
    //Instance member
    public String myJavaHelloWorld()
    {
        return "Hello World from Java!!";
    }
    //Instance member
    public double myJavaAdd(double a, double b)
    {
        return a+b;
    }
}

you can call the previous Java class from C# using JCOBridge access to static and instance methods.

How to call Java code

Define a class that use the Java code:

class MyJavaUsingClass : SetupJVMWrapper
{
    public void Execute()
    {
        string hello = DynJVM.MyJavaClass.myStaticJavaHelloWorld();
        Console.WriteLine(hello); //Print "Hello Static World from Java!!"
        var myJavaClass = DynJVM.MyJavaClass.@new();
        hello = myJavaClass.myJavaHelloWorld();
        Console.WriteLine(hello); //Print "Hello World from Java!!"
        double result = myJavaClass.myJavaAdd(2.0, 3.0);
        Console.WriteLine("{1:0.0}",result); //Print "5.0"
    }
}

Add JCOBridge initialization before call the Execute method.

using MASES.LicenseManager.Common;
using MASES.JCBridge.C2JBridge;
using System;

static void Main(string[] args)
{
    MyJavaUsingClass JavaTest = new MyJavaUsingClass();
    JavaTest.Execute();
}

Other JCOBridge Examples

More information and more complex examples on www.jcobridge.com. Meanwhile try the NuGet templates package with ready to use projects. NuGet JCOBridge Templates

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Core netcoreapp3.1
.NET Framework net461 net462 net463 net47 net471 net472 net48
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on MASES.JCOBridge:

Package Downloads
MASES.JNet

JNet - .NET gateway for JVM APIs (Java, Scala, Kotlin, ...) to use .NET and JVM side-by-side

MASES.JCOReflectorEngine

JCOReflector Engine - JCOBridge based Java class generator that mimic .NET classes

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.4.14 340,345 8/18/2022
2.4.13 200 8/16/2022
2.4.12 34,391 5/7/2022
2.4.11 412 4/28/2022
2.4.10 287 4/13/2022
2.4.9 4,869 3/28/2022
2.4.8 614 3/19/2022
2.4.7 1,504 3/9/2022
2.4.6 1,200 2/5/2022
2.4.5 221 1/8/2022
2.4.4 177 1/3/2022
2.4.3 386 12/13/2021
2.4.1 774 11/21/2021
2.4.0 383 11/13/2021

Version 2.4.14:
- Fix on previous version