Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Calling Java from C#

Calling Java from C#

Scheduled Pinned Locked Moved C#
csharpjavatutorialquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    BrcKcc
    wrote on last edited by
    #1

    Anyone have some good example code for calling Java routines from C#? - Bruce :confused: BRCKCC

    J H 2 Replies Last reply
    0
    • B BrcKcc

      Anyone have some good example code for calling Java routines from C#? - Bruce :confused: BRCKCC

      J Offline
      J Offline
      Judah Gabriel Himango
      wrote on last edited by
      #2

      Unless you're able to convert the Java .class file to a .NET assembly, I believe this will require either a COM bridge or Mono's IKVM Java runtime. Mono lead dev Miguel de Icaza wrote a Java app on top of Mono that might get you pointed in the right direction: clickity[^]. Additionally, if you have the Java source code, you could try recompiling as J# code which gets compiled as a .NET assembly. #include "witty_sig.h"

      1 Reply Last reply
      0
      • B BrcKcc

        Anyone have some good example code for calling Java routines from C#? - Bruce :confused: BRCKCC

        H Offline
        H Offline
        Heath Stewart
        wrote on last edited by
        #3

        I've got an article on that at http://www.devx.com/interop/Article/19845[^]. It's a new edition of an article[^] I wrote for CodeProject alost two years ago, which was a rewrite of an article I wrote about a year before that. Sure, there are already bridge products that have been out for a couple years, but these articles will tell you how it's done (using JNI and, optionally, COM - though not required if you P/Invoke native functions from the JNI library you'd have to write). The DevX article I linked first goes into greater depth about calling Java methods from the JNI DLL.

        Microsoft MVP, Visual C# My Articles

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups