GithubHelp home page GithubHelp logo

smilinger / j2net Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chequer-io/j2net

0.0 1.0 0.0 299.33 MB

Provides an environment for running Java in .NET

License: MIT License

Shell 46.06% Java 2.68% C# 51.27%

j2net's Introduction

J2NET

Nuget
Provides an environment for running Java in .NET

Support

Platform Architecture Package
macOS Intel (X64) J2NET.Runtime.macOS-x64
macOS Apple Silicon (ARM64) J2NET.Runtime.macOS-arm64
Linux X64 J2NET.Runtime.linux-x64
Linux ARM64 J2NET.Runtime.linux-arm64
Alpine X64 J2NET.Runtime.linux-musl-x64
Windows X64 J2NET.Runtime.win-x64
Windows X86 J2NET.Runtime.win-x86

Getting Started

1. Install NuGet package

Install the latest version of the J2NET package from NuGet.

2. Add Runtime package reference

Paste the following XML into your Project(.csproj / .vbproj / .fsproj) file.

<PropertyGroup>
    <RuntimeVersion>1.3.0</RuntimeVersion>
    <OSPlatform Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'true'">OSX</OSPlatform>
    <OSPlatform Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' == 'true'">Linux</OSPlatform>
    <OSPlatform Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true'">Windows</OSPlatform>
    <OSArchitecture>$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)</OSArchitecture>
</PropertyGroup>

<ItemGroup>
    <PackageReference Condition=" '$(OSPlatform)' == 'OSX' And '$(OSArchitecture)' == 'X64' " Include="J2NET.Runtime.macOS-x64" Version="$(RuntimeVersion)" />
    <PackageReference Condition=" '$(OSPlatform)' == 'OSX' And '$(OSArchitecture)' == 'ARM64' " Include="J2NET.Runtime.macOS-arm64" Version="$(RuntimeVersion)" />
    <PackageReference Condition=" '$(OSPlatform)' == 'Linux' And '$(OSArchitecture)' == 'X64' " Include="J2NET.Runtime.linux-x64" Version="$(RuntimeVersion)" />
    <PackageReference Condition=" '$(OSPlatform)' == 'Linux' And '$(OSArchitecture)' == 'ARM64' " Include="J2NET.Runtime.linux-arm64" Version="$(RuntimeVersion)" />
    <PackageReference Condition=" '$(OSPlatform)' == 'Windows' And '$(OSArchitecture)' == 'X64' " Include="J2NET.Runtime.win-x64" Version="$(RuntimeVersion)" />
    <PackageReference Condition=" '$(OSPlatform)' == 'Windows' And '$(OSArchitecture)' == 'X86' " Include="J2NET.Runtime.win-x86" Version="$(RuntimeVersion)" />
</ItemGroup>

3. Run the Code!

var process = JavaRuntime.ExecuteJar("../../../Sample/Sample.jar");
process.WaitForExit();

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.