How ? .net call Java class

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • SmartGuy

    #1

    How ? .net call Java class

    hi.everyone..
    Suppose, i have a Java class:

    public class Test{
    public String testMethod(Stri ng args){
    return "Hi I am Java";
    }
    }
    How could .net call method "testMethod "? Any suggestions,or related links?
    Also welcome to discuss via msn : seu_li at hotmail dot com.
    thanks any replies in advance.
  • Ed Kaim [MSFT]

    #2
    Re: How ? .net call Java class

    The easiest way is to compile the Java code with J# in order to build a .NET
    DLL. Then you can reference the DLL from other .NET projects n any language.

    "SmartGuy" <SmartGuy@discu ssions.microsof t.com> wrote in message
    news:D50105B6-0643-4CA0-B60D-675843B74C29@mi crosoft.com...[color=blue]
    > hi.everyone..
    > Suppose, i have a Java class:
    >
    > public class Test{
    > public String testMethod(Stri ng args){
    > return "Hi I am Java";
    > }
    > }
    > How could .net call method "testMethod "? Any suggestions,or related links?
    > Also welcome to discuss via msn : seu_li at hotmail dot com.
    > thanks any replies in advance.[/color]


    Comment

    • Jon Skeet [C# MVP]

      #3
      Re: How ? .net call Java class

      Ed Kaim [MSFT] <edkaim@online. microsoft.com> wrote:[color=blue]
      > The easiest way is to compile the Java code with J# in order to build a .NET
      > DLL. Then you can reference the DLL from other .NET projects n any language.[/color]

      Well, that's only the easiest way if the Java code only requires Java
      1.1, isn't it? (Unless I've misread something, J# doesn't support
      Java2, i.e. Java 1.2 and higher.)

      Another possibility is a Java<->.NET bridge: see


      --
      Jon Skeet - <skeet@pobox.co m>
      Pobox has been discontinued as a separate service, and all existing customers moved to the Fastmail platform.

      If replying to the group, please do not mail me too

      Comment

      • Nick Malik

        #4
        Re: How ? .net call Java class

        perhaps this article will fill in some of the blanks for you.


        --- Nick

        "SmartGuy" <SmartGuy@discu ssions.microsof t.com> wrote in message
        news:D50105B6-0643-4CA0-B60D-675843B74C29@mi crosoft.com...[color=blue]
        > hi.everyone..
        > Suppose, i have a Java class:
        >
        > public class Test{
        > public String testMethod(Stri ng args){
        > return "Hi I am Java";
        > }
        > }
        > How could .net call method "testMethod "? Any suggestions,or related[/color]
        links?[color=blue]
        > Also welcome to discuss via msn : seu_li at hotmail dot com.
        > thanks any replies in advance.[/color]


        Comment

        • Wayne Citrin

          #5
          Re: How ? .net call Java class

          "Jon Skeet [C# MVP]" <skeet@pobox.co m> wrote in message
          news:MPG.1b61b2 5698b2b29098aed c@msnews.micros oft.com...[color=blue]
          > Ed Kaim [MSFT] <edkaim@online. microsoft.com> wrote:[color=green]
          > > The easiest way is to compile the Java code with J# in order to build a[/color][/color]
          ..NET[color=blue][color=green]
          > > DLL. Then you can reference the DLL from other .NET projects n any[/color][/color]
          language.[color=blue]
          >
          > Well, that's only the easiest way if the Java code only requires Java
          > 1.1, isn't it? (Unless I've misread something, J# doesn't support
          > Java2, i.e. Java 1.2 and higher.)
          >
          > Another possibility is a Java<->.NET bridge: see
          > http://j-integra.intrinsyc.com/[/color]

          Since we're mentioning bridging products, we should also mention
          JNBridgePro. See www.jnbridge.com.

          BTW, if you only have binary for your Java code, you pretty much need a
          bridge or similar technology to accomplish the interop.

          Wayne
          _______________ _______________ ______
          Wayne Citrin
          JNBridge, LLC
          citrin@jnbridge .com
          JNBridge connects Java and .NET applications so enterprise teams can reuse existing code, call Java from C# or .NET from Java, and modernize without rewrites.

          Spanning the Worlds of Java and .NET
          _______________ _______________ ______


          Comment

          • Jon Skeet [C# MVP]

            #6
            Re: How ? .net call Java class

            Wayne Citrin <citrin@jnbridg e.com> wrote:[color=blue][color=green]
            > > Another possibility is a Java<->.NET bridge: see
            > > http://j-integra.intrinsyc.com/[/color]
            >
            > Since we're mentioning bridging products, we should also mention
            > JNBridgePro. See www.jnbridge.com.
            >
            > BTW, if you only have binary for your Java code, you pretty much need a
            > bridge or similar technology to accomplish the interop.[/color]

            I knew there was another popular one - just couldn't remember the name.
            Apologies :(

            --
            Jon Skeet - <skeet@pobox.co m>
            Pobox has been discontinued as a separate service, and all existing customers moved to the Fastmail platform.

            If replying to the group, please do not mail me too

            Comment

            Working...