Welcome to mirror list, hosted at ThFree Co, Russian Federation.

net2java.xml « devguide « xdocs « content « documentation « src « website - github.com/mono/ikvm-fork.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b89c06bc33664a7b4ea5ae3920d314cbbb6301f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.2//EN" "http://apache.org/forrest/dtd/document-v12.dtd">
<document> 
  <header> 
    <title>Using Java API's in .NET Applications</title> 
     <abstract>This section discusses information of interest to developers
       who want to use Java API's in their .NET applications. </abstract>
  </header> 
  <body> 

   <section>
      <title>Overview</title>
      
      <p>IKVM makes it possible to develop .NET applications that use Java API's. Here's how to proceed:</p>
      <ol>
        <li>IKVM comes with an implementation of the Java class libraries in .NET. To use those API's, simply add
        a reference to IKVM.OpenJDK.ClassLibrary.dll to your Mono / .NET IDE project. </li>
        <li>To use other Java API's, you can take one of the following approaches:
            <ul>
               <li>Convert the Java API to .NET CIL using <link href="ext:ikvmc">ikvmc</link>.
                       This produces a .NET dll that you can reference in your project. </li>
                <li>Use the Java reflection API's to dynamically load and execute the Java bytecode using the
                        IKVM bytecode interpreter.
                        For example, your application can load Java bytecode over a network connection
                        and execute it dynamically.</li>
            </ul>
        </li>
      </ol>
      
    </section>

    <section>
      <title>Java / .NET Interoperability Issues</title>
      
      <p>When calling Java API's from a .NET language such as C#, you will need to know 
      how to deal with the gap between the .NET and Java object models. For example, Java and .NET
      both have their own String class, primitive wrapper classes, exception hierarchy, and so on. 
      Eventually, that information will be included in this manual. For now, you can use the following
      as resources:</p>
      
      <ul>
        <li>The <link href="http://weblog.ikvm.net">IKVM WebLog</link> has several
          helpful entries. The series from February 29 - March 10 describe the object model.</li>
        <li>The hodgepodge sample in the <link href="site:download">sample distribution</link>
        is a simple demonstration of using Java API's from a C# application.</li>
        <li>The IKVM source code is the ultimate reference, of course. </li>
      </ul>
    </section>
    
    <section>
      <title>Subclassing Java Code</title>
      <p>See IKVM Weblog Article: March 9</p>
    </section>
    
  </body>
</document>