locked
How to run java jar file in .net application RRS feed

  • Question

  •  

    Hello to every one

                         I create one application in java technology.It works fine.But problem is, to run the (java application) jar file in .net application.I tried, but i didn't get the solution.Is there anybody know the way please help me, I eagerly waiting for your quick reply...........

     

    Thursday, May 29, 2008 6:05 AM

Answers

  •  satishsv74 wrote:
     

    But problem is, to run the (java application) jar file in .net application.

     

    This is can be a very tricky.  There is no automatic way to use a Java .jar file (or any other organization of Java .class files) directly as part of .NET. 

     

    A RANGE OF DIFFICULT OPTIONS

     

    Without knowing exactly the kind of integration that you are attempting, it is difficult to say more.  If you are attempting to run Java-developed classes as components directly in the .NET application, it is necessary to find a way to run the Java Virtual Machine and then communicate between the .NET application to the JVM, which is operating the Java code.  This requires creating and using bridge code between .NET and the JVM.  You can investigate tools for this.  (See below.)

     

    The popular form of interoperability between Java and .NET applications is to use web services and communicate between the separate processes.  This loose coupling might not work for you, depending on how intimately the Java classes must work within the application.  (An example requiring tighter coupling would be if the application GUI needed to be used by the Java code too.)   The Java code and the .NET code must be written to cooperate in this way.  Is it perhaps more appropriate to convert the Java code to C# for .NET operation? 

     

    FINDING OUT MORE

     

    There are vendors who provide a variety of third-party solutions to Java-.NET integration.  Try a web search with the two terms "java" and "interop".  Search for MainSoft and JNBRIDGE too.  This overview on DevX may be helpful.

     

    STEPPING BACK

     

    I suggest that you step back from wanting to execute Java code from .NET and look more at the problem you need to solve first.  What would be the simplest way that could possibly work in your situation?  I am thinking of questions like this: Could you pass files between the two applications?  How about using an operating-system pipe?  Could they share a database?  Could you use a single platform .NET or Java for the complete application? ... Also, consider the specialized knowledge required to create a tight coupling and also to maintain that application in the future.

     

    IT CAN BE DONE

     

    I don't want to discourage the solution if it seems like the best alternative.  I have encountered scenarios where tightly-coupled bridging is necessary.  Be aware that most developers attempt to avoid this solution if at all possible.  It requires specialized skills that are not widely available.  Be prepared for technical challenges.

     

     

     

     

    Thursday, May 29, 2008 3:51 PM
  • Hi Satish --

     

    There are definitely ways to do this, and I would disagree with the other poster -- it's quite simple to do.  There are a number of products that support Java-.NET interoperability -- simply do a search on any search engine to find them.

     

    I will take the liberty to mention our own product, JNBridgePro, which will solve this problem.  Please see www.jnbridge.com for more information.


    Regards,

    Wayne

     

    • Marked as answer by David DoBell Friday, June 27, 2008 4:21 AM
    Thursday, May 29, 2008 4:28 PM

All replies

  •  satishsv74 wrote:
     

    But problem is, to run the (java application) jar file in .net application.

     

    This is can be a very tricky.  There is no automatic way to use a Java .jar file (or any other organization of Java .class files) directly as part of .NET. 

     

    A RANGE OF DIFFICULT OPTIONS

     

    Without knowing exactly the kind of integration that you are attempting, it is difficult to say more.  If you are attempting to run Java-developed classes as components directly in the .NET application, it is necessary to find a way to run the Java Virtual Machine and then communicate between the .NET application to the JVM, which is operating the Java code.  This requires creating and using bridge code between .NET and the JVM.  You can investigate tools for this.  (See below.)

     

    The popular form of interoperability between Java and .NET applications is to use web services and communicate between the separate processes.  This loose coupling might not work for you, depending on how intimately the Java classes must work within the application.  (An example requiring tighter coupling would be if the application GUI needed to be used by the Java code too.)   The Java code and the .NET code must be written to cooperate in this way.  Is it perhaps more appropriate to convert the Java code to C# for .NET operation? 

     

    FINDING OUT MORE

     

    There are vendors who provide a variety of third-party solutions to Java-.NET integration.  Try a web search with the two terms "java" and "interop".  Search for MainSoft and JNBRIDGE too.  This overview on DevX may be helpful.

     

    STEPPING BACK

     

    I suggest that you step back from wanting to execute Java code from .NET and look more at the problem you need to solve first.  What would be the simplest way that could possibly work in your situation?  I am thinking of questions like this: Could you pass files between the two applications?  How about using an operating-system pipe?  Could they share a database?  Could you use a single platform .NET or Java for the complete application? ... Also, consider the specialized knowledge required to create a tight coupling and also to maintain that application in the future.

     

    IT CAN BE DONE

     

    I don't want to discourage the solution if it seems like the best alternative.  I have encountered scenarios where tightly-coupled bridging is necessary.  Be aware that most developers attempt to avoid this solution if at all possible.  It requires specialized skills that are not widely available.  Be prepared for technical challenges.

     

     

     

     

    Thursday, May 29, 2008 3:51 PM
  • Hi Satish --

     

    There are definitely ways to do this, and I would disagree with the other poster -- it's quite simple to do.  There are a number of products that support Java-.NET interoperability -- simply do a search on any search engine to find them.

     

    I will take the liberty to mention our own product, JNBridgePro, which will solve this problem.  Please see www.jnbridge.com for more information.


    Regards,

    Wayne

     

    • Marked as answer by David DoBell Friday, June 27, 2008 4:21 AM
    Thursday, May 29, 2008 4:28 PM