JCOBridge.Examples.Templates 2.1.0

Ready made templates to create applications based on JCOBridge. The templates are ready made starting points, all information and APIs are available in the official website https://www.jcobridge.com/

Additional Details

Latest template contains error codes

There is a newer version of this package available.
See the version list below for details.
dotnet new --install JCOBridge.Examples.Templates::2.1.0
This package contains a .NET Core Template Package you can call from the shell/command line.

JCOBridge Template Usage Guide

Getting Started

Install templates

  1. Run the following command on a machine where .Net Core is installed:

dotnet new install JCOBridge.Examples.Templates

Now you have installed three different templates: a simple console app, a simple app will show an AWT frame, a simple app will invokes scala classes

All templates targets both .NET Core 3.1 and .NET Framework (> 4.6.1)

Use one template

  1. Run the command to install the simple console app:

dotnet new jcobridgeConsoleApp

Run the examples

  1. Run the application setting the location of the JRE-JVM library:

dotnet run --framework netcoreapp3.1 --JVMPath:"C:/Program Files/Java/jre1.8.0_241/bin/server/jvm.dll"

dotnet run --framework net461 --JVMPath:"C:/Program Files/Java/jre1.8.0_241/bin/server/jvm.dll"

Advanced: .NET invoking JVM languages

A lot of new programming languages (see List of JVM languages) use a JVM as runtime environment. The ready made template jcobridgeScalaApp is an example able to run Scala code from a .NET environment:

Use jcobridgeScalaApp template

  1. Run the command to install the simple console app:

dotnet new jcobridgeScalaApp

Run the examples

  1. Run the application setting the location of the JRE-JVM library:

dotnet run --framework netcoreapp3.1 --JVMPath:"C:/Program Files/Java/jre1.8.0_241/bin/server/jvm.dll"

dotnet run --framework net461 --JVMPath:"C:/Program Files/Java/jre1.8.0_241/bin/server/jvm.dll"

Advanced: JVM invoking .NET API

Another use of JCOBridge is to invoke .NET API from JVM (or JVM enabled languages). The jcobridgeJavaNativeApp template is the starting point to write code in JVM which invokes .NET API.
Any JVM enabled language (see List of JVM languages) can be used instead of Java to invoke .NET API.
The template can be the starting point to use IoT boards with ready made packages for GPIO management from any JVM enabled language.

Use jcobridgeJavaNativeApp template

  1. Run the command to install the simple console app:

dotnet new jcobridgeJavaNativeApp

Compile the .NET side of the example

  1. Run the following command:

dotnet build net/jcobridgeJavaNativeApp.csproj

Run the Java example

  1. Open a Visual Studio Code in the example root and run the java code.

JCOBridge Template Usage Guide

Getting Started

Install templates

  1. Run the following command on a machine where .Net Core is installed:

dotnet new install JCOBridge.Examples.Templates

Now you have installed three different templates: a simple console app, a simple app will show an AWT frame, a simple app will invokes scala classes

All templates targets both .NET Core 3.1 and .NET Framework (> 4.6.1)

Use one template

  1. Run the command to install the simple console app:

dotnet new jcobridgeConsoleApp

Run the examples

  1. Run the application setting the location of the JRE-JVM library:

dotnet run --framework netcoreapp3.1 --JVMPath:"C:/Program Files/Java/jre1.8.0_241/bin/server/jvm.dll"

dotnet run --framework net461 --JVMPath:"C:/Program Files/Java/jre1.8.0_241/bin/server/jvm.dll"

Advanced: .NET invoking JVM languages

A lot of new programming languages (see List of JVM languages) use a JVM as runtime environment. The ready made template jcobridgeScalaApp is an example able to run Scala code from a .NET environment:

Use jcobridgeScalaApp template

  1. Run the command to install the simple console app:

dotnet new jcobridgeScalaApp

Run the examples

  1. Run the application setting the location of the JRE-JVM library:

dotnet run --framework netcoreapp3.1 --JVMPath:"C:/Program Files/Java/jre1.8.0_241/bin/server/jvm.dll"

dotnet run --framework net461 --JVMPath:"C:/Program Files/Java/jre1.8.0_241/bin/server/jvm.dll"

Advanced: JVM invoking .NET API

Another use of JCOBridge is to invoke .NET API from JVM (or JVM enabled languages). The jcobridgeJavaNativeApp template is the starting point to write code in JVM which invokes .NET API.
Any JVM enabled language (see List of JVM languages) can be used instead of Java to invoke .NET API.
The template can be the starting point to use IoT boards with ready made packages for GPIO management from any JVM enabled language.

Use jcobridgeJavaNativeApp template

  1. Run the command to install the simple console app:

dotnet new jcobridgeJavaNativeApp

Compile the .NET side of the example

  1. Run the following command:

dotnet build net/jcobridgeJavaNativeApp.csproj

Run the Java example

  1. Open a Visual Studio Code in the example root and run the java code.

Release Notes

Added a new template which invokes .NET API from a running JVM.
The same template has a short stub where CLR invokes the JVM during an API invocation started from JVM: using DynJVM property a developer can access every class/object/field available within the JVM to complete a task.
The jcobridgeJavaNativeApp template can be expanded, using the others available or using the examples on https://www.jcobridge.com/, to create code which is able to manage events raised from JVM or CLR which invokes methods on CLR or JVM.
One example of events from JVM is available in the jcobridgeAWTApp: in that case the event is raised from the Graphical subsystem, but can be raised from any object.

  • .NETCoreApp 3.1

    • No dependencies.
  • .NETFramework 4.6.1

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
2.3.2 115 3/5/2021
2.3.1 243 12/7/2020
2.3.0 152 11/15/2020
2.2.1 159 6/3/2020
2.2.0 139 5/16/2020
2.1.1 169 4/15/2020
2.1.0 249 4/15/2020
2.0.1 177 4/9/2020
Show less