<p>本文摘译自:<a href="http://www.ikvm.net/" target="_blank"><span style="font-size: small;"><span style="color: #c60a00;">IKVM</span>.NET Home Page</span></a></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style='color: black; font-family: "Times New Roman","serif";'><span style="font-size: medium;"><span style="font-size: small;">程序可以从</span><a href="http://download.csdn.net/source/1196448"><span style="font-size: small;">ikvm-0.38.0.2(32位)</span></a>和<span style="font-size: small;"><a href="http://download.csdn.net/source/1196451">ikvm-0.38.0.2(64位)</a></span><span style="font-size: small;">下载。</span></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><strong style=""><span style='font-size: 16pt; color: black; font-family: "Times New Roman","serif";'>IKVM.NET </span></strong><strong style=""><span style="">二进行代码编译器(</span></strong><strong style=""><span style='font-size: 16pt; color: black; font-family: "Times New Roman","serif";'>ikvmc.exe</span></strong><strong style=""><span style="">)</span></strong></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="" lang="EN-US"></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>ikvmc</span><span style="">是将</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>Java</span><span style="">二进行代码转换成</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>.NET</span><span style="">动态链接器(</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>.dll</span><span style="">)和可执行文件(</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>.exe</span><span style="">)的工具。</span></p>
<p class="MsoNormal" style="" align="left"><span style="font-size: 10pt; color: black; font-family: Symbol;" lang="EN-US"><span style="">·<span style='font: 7pt "Times New Roman";'> </span></span></span><span style="font-size: small;"><span style="">语法</span></span></p>
<p class="MsoNormal" style="" align="left"><span style="font-size: 10pt; color: black; font-family: Symbol;" lang="EN-US"><span style="">·<span style='font: 7pt "Times New Roman";'> </span></span></span><span style="font-size: small;"><span style="">参数</span></span></p>
<p class="MsoNormal" style="" align="left"><span style="font-size: 10pt; color: black; font-family: Symbol;" lang="EN-US"><span style="">·<span style='font: 7pt "Times New Roman";'> </span></span></span><span style="font-size: small;"><span style="">几点说明</span></span></p>
<p class="MsoNormal" style="" align="left"><span style="font-size: 10pt; color: black; font-family: Symbol;" lang="EN-US"><span style="">·<span style='font: 7pt "Times New Roman";'> </span></span></span><span style="font-size: small;"><span style="">示例</span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><strong style=""><span style="">语法(译者注:这个工具是在windows命令提示窗中使用的)</span></strong></p>
<p>
</p>
<table class="MsoNormalTable" style="width: 100%;" border="0" cellspacing="1" cellpadding="0"><tbody><tr style="">
<td style="background: #f0f0ff; width: 421.3pt; border: #ece9d8; padding: 3pt;" width="562">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">ikvmc [ <em style="">options</em> ] <em style="">classOrJarfile</em> [ <em style="">classOrJarfile ...</em></span><span style="" lang="EN-US"> ]</span></p>
</td>
</tr></tbody></table>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">参数</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 36pt; text-align: left;" align="left"><span style="">见下。</span><span style=""> </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">类文件(</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>.class</span><span style="">)或包文件(</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>.jar</span><span style="">)</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 36pt; text-align: left;" align="left"><a name="N1003A"><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>Java</span></a><span style=""><span style="">类或包文件的名字可以含有通配符(如</span></span><span style=""><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>*.class</span></span><span style=""><span style="">)。</span></span><span style=""><span style=""> </span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><strong style=""><span style="">参数</span></strong><strong style=""></strong></p>
<p>
</p>
<table class="MsoNormalTable" style="width: 100%;" border="0" cellspacing="1" cellpadding="0"><tbody>
<tr style="">
<td style="background: #7099c5; width: 100.35pt; border: #ece9d8; padding: 3pt;" width="134">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: center;" align="center"><strong style=""><span style="">参数</span></strong></p>
</td>
<td style="background: #7099c5; width: 320.25pt; border: #ece9d8; padding: 3pt;" width="427">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: center;" align="center"><strong style=""><span style="">说明</span></strong></p>
</td>
</tr>
<tr style="">
<td style="background: #f0f0ff; width: 100.35pt; border: #ece9d8; padding: 3pt;" width="134">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>-out:</span><span style="">输出文件</span></p>
</td>
<td style="background: #f0f0ff; width: 320.25pt; border: #ece9d8; padding: 3pt;" width="427">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">指定输出文件的文件名。文件名应含有扩展名</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>.dll</span><span style="">(参数</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>-target</span><span style="">设为</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>library</span><span style="">时)或</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>.exe</span><span style="">(参数</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>-target</span><span style="">设为</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>exe</span><span style="">或</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>winexe</span><span style="">时)。一般地,缺省状态下</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>ikvmc</span><span style="">会根据输入文件名和</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>-target</span><span style="">参数来确定输出文件名。但是,如果在输入文件名中使用了通配符,那么就必须使用这个选项来指定输出文件名。</span></p>
</td>
</tr>
<tr style="">
<td style="background: #f0f0ff; width: 100.35pt; border: #ece9d8; padding: 3pt;" width="134">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>-assembly:</span><span style="">程序集名称</span></p>
</td>
<td style="background: #f0f0ff; width: 320.25pt; border: #ece9d8; padding: 3pt;" width="427">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">指定生成的程序集名称。一般地,缺省状态下,程序集名就是输出文件名。</span><span style=""> </span></p>
</td>
</tr>
<tr style="">
<td style="background: #f0f0ff; width: 100.35pt; border: #ece9d8; padding: 3pt;" width="134">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>-target:</span><span style="">目标类型</span></p>
</td>
<td style="background: #f0f0ff; width: 320.25pt; border: #ece9d8; padding: 3pt;" width="427">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">指定生成目标</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>.exe</span><span style="">或</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>.dll</span><span style="">文件的类型,可以指定如下值:</span></p>
<ul type="disc">
<li class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; color: black; text-align: left;">
<span style='font-size: 11pt; font-family: "Times New Roman","serif";'>exe——</span><span style="">生成一个在</span><span style='font-size: 11pt; font-family: "Times New Roman","serif";'>windows</span><span style="">命令窗口中运行的可执行程序。</span>
</li>
<li class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; color: black; text-align: left;">
<span style='font-size: 11pt; font-family: "Times New Roman","serif";'>winexe——</span><span style="">生成一个带有界面的</span><span style='font-size: 11pt; font-family: "Times New Roman","serif";'>.exe</span><span style="">应用程序。</span>
</li>
<li class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; color: black; text-align: left;">
<span style='font-size: 11pt; font-family: "Times New Roman","serif";'>library——</span><span style="">生成一个动态链接库(</span><span style='font-size: 11pt; font-family: "Times New Roman","serif";'>.dll</span><span style="">)文件。</span>
</li>
<li class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; color: black; text-align: left;">
<span style='font-size: 11pt; font-family: "Times New Roman","serif";'>module——</span><span style="">生成一个</span><span style='font-size: 11pt; font-family: "Times New Roman","serif";'>.net</span><span style="">模块。</span>
</li>
</ul>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">在</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>Linux</span><span style="">平台上,</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>exe</span><span style="">与</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>winexe</span><span style="">两个参数是没有区别的。</span></p>
</td>
</tr>
<tr style="">
<td style="background: #f0f0ff; width: 100.35pt; border: #ece9d8; padding: 3pt;" width="134">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">-keyfile:</span><span style="">主文件名。</span></p>
</td>
<td style="background: #f0f0ff; width: 320.25pt; border: #ece9d8; padding: 3pt;" width="427">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">主文件名用于指定结果程序集。</span><span style=""> </span></p>
</td>
</tr>
<tr style="">
<td style="background: #f0f0ff; width: 100.35pt; border: #ece9d8; padding: 3pt;" width="134">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>-version:M.m.b.r</span></p>
</td>
<td style="background: #f0f0ff; width: 320.25pt; border: #ece9d8; padding: 3pt;" width="427">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">指定程序集版本。</span><span style=""> </span></p>
</td>
</tr>
<tr style="">
<td style="background: #f0f0ff; width: 100.35pt; border: #ece9d8; padding: 3pt;" width="134">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>-main:</span><span style="">类名</span></p>
</td>
<td style="background: #f0f0ff; width: 320.25pt; border: #ece9d8; padding: 3pt;" width="427">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">指定含有</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>main</span><span style="">函数的类的名称。缺省情况下,如果</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>-target</span><span style="">参数设置为</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>exe</span><span style="">或</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>winexe</span><span style="">,</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>ikvmc</span><span style="">会搜寻合法的</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>main</span><span style="">函数,在找到的情况下会给用户提示。</span><span style=""> </span></p>
</td>
</tr>
<tr style="">
<td style="background: #f0f0ff; width: 100.35pt; border: #ece9d8; padding: 3pt;" width="134">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">-reference:</span><span style="">指定类库位置</span></p>
</td>
<td style="background: #f0f0ff; width: 320.25pt; border: #ece9d8; padding: 3pt;" width="427">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">如果</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>Java</span><span style="">代码使用了</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>.NET</span><span style="">的编程接口(</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>API</span><span style="">),那么使用这个选项指定这些动态链接库(</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>dll</span><span style="">)。如果引用了不止一个类库文件,那么此选项可以多次使用。可以使用通配符(例如:</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>c:\libs\*.dll</span><span style="">)。</span><span style=""> </span></p>
</td>
</tr>
<tr style="">
<td style="background: #f0f0ff; width: 100.35pt; border: #ece9d8; padding: 3pt;" width="134">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>-</span><span style=""> recurse:<em style="">filespec</em></span></p>
</td>
<td style="background: #f0f0ff; width: 320.25pt; border: #ece9d8; padding: 3pt;" width="427">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">处理当前文件夹下所有可与filespec匹配的文件。例如:</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>-</span><span style=""> recurse: *.class</span></p>
</td>
</tr>
<tr style="">
<td style="background: #f0f0ff; width: 100.35pt; border: #ece9d8; padding: 3pt;" width="134">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>-nojni</span></p>
</td>
<td style="background: #f0f0ff; width: 320.25pt; border: #ece9d8; padding: 3pt;" width="427">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">对于非</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>Java</span><span style="">函数(</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>native methods</span><span style="">)不要生成用于非</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>Java</span><span style="">代码的Java接口(</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>JNI</span><span style="">)。</span></p>
</td>
</tr>
<tr style="">
<td style="background: #f0f0ff; width: 100.35pt; border: #ece9d8; padding: 3pt;" width="134">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">-resource:</span><em style=""><span style="">路径名</span></em></p>
</td>
<td style="background: #f0f0ff; width: 320.25pt; border: #ece9d8; padding: 3pt;" width="427">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">指定</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>Java</span><span style="">资源的引用路径名。</span></p>
</td>
</tr>
<tr style="">
<td style="background: #f0f0ff; width: 100.35pt; border: #ece9d8; padding: 3pt;" width="134">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>-exclude:</span><span style="">文件名</span></p>
</td>
<td style="background: #f0f0ff; width: 320.25pt; border: #ece9d8; padding: 3pt;" width="427">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">要排除的类名列表。</span></p>
</td>
</tr>
<tr style="">
<td style="background: #f0f0ff; width: 100.35pt; border: #ece9d8; padding: 3pt;" width="134">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>-debug</span></p>
</td>
<td style="background: #f0f0ff; width: 320.25pt; border: #ece9d8; padding: 3pt;" width="427">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">将调试信息输出。注意:只有当</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>.class</span><span style="">文件含有调试信息(即使用</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>javac-g</span><span style="">参数编译)时才有用。</span><span style=""> </span></p>
</td>
</tr>
<tr style="">
<td style="background: #f0f0ff; width: 100.35pt; border: #ece9d8; padding: 3pt;" width="134">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">-srcpath:</span><em style=""><span style="">路径</span></em></p>
</td>
<td style="background: #f0f0ff; width: 320.25pt; border: #ece9d8; padding: 3pt;" width="427">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">指定源代码的位置。与</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>-debug</span><span style="">同时使用。程序会将包中类的搜索路径指定为此路径,并从中搜索类的源代码。</span><span style=""> </span></p>
</td>
</tr>
<tr style="">
<td style="background: #f0f0ff; width: 100.35pt; border: #ece9d8; padding: 3pt;" width="134">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">-Xtrace:</span><em style=""><span style="">名称</span></em><span style=""> </span></p>
</td>
<td style="background: #f0f0ff; width: 320.25pt; border: #ece9d8; padding: 3pt;" width="427">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">显示所有该指定名称的跟踪点。</span></p>
</td>
</tr>
<tr style="">
<td style="background: #f0f0ff; width: 100.35pt; border: #ece9d8; padding: 3pt;" width="134">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">-Xmethodtrace:</span><em style=""><span style="">函数名</span></em><span style=""> </span></p>
</td>
<td style="background: #f0f0ff; width: 320.25pt; border: #ece9d8; padding: 3pt;" width="427">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">指定的生成的函数名,将函数跟踪器(</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>method trace</span><span style="">)生成到此函数中。</span><span style=""> </span></p>
</td>
</tr>
</tbody></table>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><a name="N1016E"><strong style=""><span style="">几点说明</span></strong></a><span style=""><strong style=""></strong></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>ikvmc</span><span style="">利用</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>Java</span><span style="">类文件和包文件生成</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>.NET</span><span style="">程序集。它将输入文件中的</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>Java</span><span style="">二进行代码转化成</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>.NET</span><span style="">公共中间语言(</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>CIL</span><span style="">)。并利用它来生成:</span></p>
<ul type="disc">
<li class="MsoNormal" style="margin: 0cm 0cm 0pt; color: black; text-align: left;">
<span style='font-size: 11pt; font-family: "Times New Roman","serif";'>.NET</span><span style="">可执行文件(</span><span style='font-size: 11pt; font-family: "Times New Roman","serif";'>-target:exe or –target:winexe</span><span style="">)</span>
</li>
<li class="MsoNormal" style="margin: 0cm 0cm 0pt; color: black; text-align: left;">
<span style='font-size: 11pt; font-family: "Times New Roman","serif";'>.NET</span><span style="">类库(</span><span style='font-size: 11pt; font-family: "Times New Roman","serif";'>-target:library</span><span style="">)</span>
</li>
<li class="MsoNormal" style="margin: 0cm 0cm 0pt; color: black; text-align: left;">
<span style='font-size: 11pt; font-family: "Times New Roman","serif";'>.NET</span><span style="">模块(</span><span style='font-size: 11pt; font-family: "Times New Roman","serif";'>-target:module</span><span style="">)</span>
</li>
</ul>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>Java</span><span style="">程序一般由一系列的包文件组成。</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>ikvmc</span><span style="">可以将多个包文件(和类文件)转化成一个单独的</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>.NET</span><span style="">可执行程序或类库文件。例如,一个程序包含</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>main.jar</span><span style="">、</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>lib1.jar</span><span style="">和</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>lib2.jar</span><span style="">可以转化成一个单独的</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>main.exe</span><span style="">文件。</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">处理多个包文件时,如果有多个相同的类或源文件,</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>ikvmc</span><span style="">会使用第一个读入的版本,而忽略以后读到的。这时会产生警告信息。因此,包文件的顺序至关重要。</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">注意:</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><a name="N1018D"><span style="">为了得到最佳结果,使用</span></a><span style=""><span style='font-size: 9pt; color: black; font-family: "Times New Roman","serif";'>ikvmc</span></span><span style=""><span style="">转换</span></span><span style=""><span style='font-size: 9pt; color: black; font-family: "Times New Roman","serif";'>Java</span></span><span style=""><span style="">程序时,请按照</span></span><span style=""><span style='font-size: 9pt; color: black; font-family: "Times New Roman","serif";'>Java</span></span><span style=""><span style="">程序中类路径的顺序在,把要转换包的列表键入</span></span><span style=""><span style='font-size: 9pt; color: black; font-family: "Times New Roman","serif";'>ikvmc</span></span><span style=""><span style="">的命令行。</span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><strong style=""><span style="">示例</span></strong><strong style=""></strong></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style='font-size: 11pt; color: black; font-family: "Courier New";'>ikvmc myProg.jar </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="" lang="EN-US"><span style=""></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">程序会自动在</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>myprog.jar</span><span style="">中查找</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>main</span><span style="">函数。如果找到了</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>main</span><span style="">函数,那么生成一个</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>.exe</span><span style="">文件;否则,生成一个</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>.dll</span><span style="">文件。</span><span style=""> </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style='font-size: 11pt; color: black; font-family: "Courier New";'>ikvmc -out:myapp.exe -main:org.anywhere.Main -recurse:bin\*.class lib\mylib.jar</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="" lang="EN-US"><span style=""></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">处理</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>bin</span><span style="">文件夹中所有的</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>.class</span><span style="">文件以及</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>lib</span><span style="">文件夹中的</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>mylib.jar</span><span style="">文件。生成一个名为</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>myapp.exe</span><span style="">的可执行文件,并把</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>org.anywhere.Main</span><span style="">作为</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>main</span><span style="">函数。</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span style="" lang="EN-US"><span style="font-size: small; font-family: Calibri;"></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style='color: black; font-family: "Times New Roman","serif";'><span style="font-size: medium;"><span style="font-size: small;">程序可以从</span><a href="http://download.csdn.net/source/1196448"><span style="font-size: small;">ikvm-0.38.0.2(32位)</span></a>和<span style="font-size: small;"><a href="http://download.csdn.net/source/1196451">ikvm-0.38.0.2(64位)</a></span><span style="font-size: small;">下载。</span></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><strong style=""><span style='font-size: 16pt; color: black; font-family: "Times New Roman","serif";'>IKVM.NET </span></strong><strong style=""><span style="">二进行代码编译器(</span></strong><strong style=""><span style='font-size: 16pt; color: black; font-family: "Times New Roman","serif";'>ikvmc.exe</span></strong><strong style=""><span style="">)</span></strong></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="" lang="EN-US"></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>ikvmc</span><span style="">是将</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>Java</span><span style="">二进行代码转换成</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>.NET</span><span style="">动态链接器(</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>.dll</span><span style="">)和可执行文件(</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>.exe</span><span style="">)的工具。</span></p>
<p class="MsoNormal" style="" align="left"><span style="font-size: 10pt; color: black; font-family: Symbol;" lang="EN-US"><span style="">·<span style='font: 7pt "Times New Roman";'> </span></span></span><span style="font-size: small;"><span style="">语法</span></span></p>
<p class="MsoNormal" style="" align="left"><span style="font-size: 10pt; color: black; font-family: Symbol;" lang="EN-US"><span style="">·<span style='font: 7pt "Times New Roman";'> </span></span></span><span style="font-size: small;"><span style="">参数</span></span></p>
<p class="MsoNormal" style="" align="left"><span style="font-size: 10pt; color: black; font-family: Symbol;" lang="EN-US"><span style="">·<span style='font: 7pt "Times New Roman";'> </span></span></span><span style="font-size: small;"><span style="">几点说明</span></span></p>
<p class="MsoNormal" style="" align="left"><span style="font-size: 10pt; color: black; font-family: Symbol;" lang="EN-US"><span style="">·<span style='font: 7pt "Times New Roman";'> </span></span></span><span style="font-size: small;"><span style="">示例</span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><strong style=""><span style="">语法(译者注:这个工具是在windows命令提示窗中使用的)</span></strong></p>
<p>
</p>
<table class="MsoNormalTable" style="width: 100%;" border="0" cellspacing="1" cellpadding="0"><tbody><tr style="">
<td style="background: #f0f0ff; width: 421.3pt; border: #ece9d8; padding: 3pt;" width="562">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">ikvmc [ <em style="">options</em> ] <em style="">classOrJarfile</em> [ <em style="">classOrJarfile ...</em></span><span style="" lang="EN-US"> ]</span></p>
</td>
</tr></tbody></table>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">参数</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 36pt; text-align: left;" align="left"><span style="">见下。</span><span style=""> </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">类文件(</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>.class</span><span style="">)或包文件(</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>.jar</span><span style="">)</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 36pt; text-align: left;" align="left"><a name="N1003A"><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>Java</span></a><span style=""><span style="">类或包文件的名字可以含有通配符(如</span></span><span style=""><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>*.class</span></span><span style=""><span style="">)。</span></span><span style=""><span style=""> </span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><strong style=""><span style="">参数</span></strong><strong style=""></strong></p>
<p>
</p>
<table class="MsoNormalTable" style="width: 100%;" border="0" cellspacing="1" cellpadding="0"><tbody>
<tr style="">
<td style="background: #7099c5; width: 100.35pt; border: #ece9d8; padding: 3pt;" width="134">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: center;" align="center"><strong style=""><span style="">参数</span></strong></p>
</td>
<td style="background: #7099c5; width: 320.25pt; border: #ece9d8; padding: 3pt;" width="427">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: center;" align="center"><strong style=""><span style="">说明</span></strong></p>
</td>
</tr>
<tr style="">
<td style="background: #f0f0ff; width: 100.35pt; border: #ece9d8; padding: 3pt;" width="134">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>-out:</span><span style="">输出文件</span></p>
</td>
<td style="background: #f0f0ff; width: 320.25pt; border: #ece9d8; padding: 3pt;" width="427">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">指定输出文件的文件名。文件名应含有扩展名</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>.dll</span><span style="">(参数</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>-target</span><span style="">设为</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>library</span><span style="">时)或</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>.exe</span><span style="">(参数</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>-target</span><span style="">设为</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>exe</span><span style="">或</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>winexe</span><span style="">时)。一般地,缺省状态下</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>ikvmc</span><span style="">会根据输入文件名和</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>-target</span><span style="">参数来确定输出文件名。但是,如果在输入文件名中使用了通配符,那么就必须使用这个选项来指定输出文件名。</span></p>
</td>
</tr>
<tr style="">
<td style="background: #f0f0ff; width: 100.35pt; border: #ece9d8; padding: 3pt;" width="134">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>-assembly:</span><span style="">程序集名称</span></p>
</td>
<td style="background: #f0f0ff; width: 320.25pt; border: #ece9d8; padding: 3pt;" width="427">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">指定生成的程序集名称。一般地,缺省状态下,程序集名就是输出文件名。</span><span style=""> </span></p>
</td>
</tr>
<tr style="">
<td style="background: #f0f0ff; width: 100.35pt; border: #ece9d8; padding: 3pt;" width="134">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>-target:</span><span style="">目标类型</span></p>
</td>
<td style="background: #f0f0ff; width: 320.25pt; border: #ece9d8; padding: 3pt;" width="427">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">指定生成目标</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>.exe</span><span style="">或</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>.dll</span><span style="">文件的类型,可以指定如下值:</span></p>
<ul type="disc">
<li class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; color: black; text-align: left;">
<span style='font-size: 11pt; font-family: "Times New Roman","serif";'>exe——</span><span style="">生成一个在</span><span style='font-size: 11pt; font-family: "Times New Roman","serif";'>windows</span><span style="">命令窗口中运行的可执行程序。</span>
</li>
<li class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; color: black; text-align: left;">
<span style='font-size: 11pt; font-family: "Times New Roman","serif";'>winexe——</span><span style="">生成一个带有界面的</span><span style='font-size: 11pt; font-family: "Times New Roman","serif";'>.exe</span><span style="">应用程序。</span>
</li>
<li class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; color: black; text-align: left;">
<span style='font-size: 11pt; font-family: "Times New Roman","serif";'>library——</span><span style="">生成一个动态链接库(</span><span style='font-size: 11pt; font-family: "Times New Roman","serif";'>.dll</span><span style="">)文件。</span>
</li>
<li class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; color: black; text-align: left;">
<span style='font-size: 11pt; font-family: "Times New Roman","serif";'>module——</span><span style="">生成一个</span><span style='font-size: 11pt; font-family: "Times New Roman","serif";'>.net</span><span style="">模块。</span>
</li>
</ul>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">在</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>Linux</span><span style="">平台上,</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>exe</span><span style="">与</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>winexe</span><span style="">两个参数是没有区别的。</span></p>
</td>
</tr>
<tr style="">
<td style="background: #f0f0ff; width: 100.35pt; border: #ece9d8; padding: 3pt;" width="134">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">-keyfile:</span><span style="">主文件名。</span></p>
</td>
<td style="background: #f0f0ff; width: 320.25pt; border: #ece9d8; padding: 3pt;" width="427">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">主文件名用于指定结果程序集。</span><span style=""> </span></p>
</td>
</tr>
<tr style="">
<td style="background: #f0f0ff; width: 100.35pt; border: #ece9d8; padding: 3pt;" width="134">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>-version:M.m.b.r</span></p>
</td>
<td style="background: #f0f0ff; width: 320.25pt; border: #ece9d8; padding: 3pt;" width="427">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">指定程序集版本。</span><span style=""> </span></p>
</td>
</tr>
<tr style="">
<td style="background: #f0f0ff; width: 100.35pt; border: #ece9d8; padding: 3pt;" width="134">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>-main:</span><span style="">类名</span></p>
</td>
<td style="background: #f0f0ff; width: 320.25pt; border: #ece9d8; padding: 3pt;" width="427">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">指定含有</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>main</span><span style="">函数的类的名称。缺省情况下,如果</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>-target</span><span style="">参数设置为</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>exe</span><span style="">或</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>winexe</span><span style="">,</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>ikvmc</span><span style="">会搜寻合法的</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>main</span><span style="">函数,在找到的情况下会给用户提示。</span><span style=""> </span></p>
</td>
</tr>
<tr style="">
<td style="background: #f0f0ff; width: 100.35pt; border: #ece9d8; padding: 3pt;" width="134">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">-reference:</span><span style="">指定类库位置</span></p>
</td>
<td style="background: #f0f0ff; width: 320.25pt; border: #ece9d8; padding: 3pt;" width="427">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">如果</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>Java</span><span style="">代码使用了</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>.NET</span><span style="">的编程接口(</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>API</span><span style="">),那么使用这个选项指定这些动态链接库(</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>dll</span><span style="">)。如果引用了不止一个类库文件,那么此选项可以多次使用。可以使用通配符(例如:</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>c:\libs\*.dll</span><span style="">)。</span><span style=""> </span></p>
</td>
</tr>
<tr style="">
<td style="background: #f0f0ff; width: 100.35pt; border: #ece9d8; padding: 3pt;" width="134">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>-</span><span style=""> recurse:<em style="">filespec</em></span></p>
</td>
<td style="background: #f0f0ff; width: 320.25pt; border: #ece9d8; padding: 3pt;" width="427">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">处理当前文件夹下所有可与filespec匹配的文件。例如:</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>-</span><span style=""> recurse: *.class</span></p>
</td>
</tr>
<tr style="">
<td style="background: #f0f0ff; width: 100.35pt; border: #ece9d8; padding: 3pt;" width="134">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>-nojni</span></p>
</td>
<td style="background: #f0f0ff; width: 320.25pt; border: #ece9d8; padding: 3pt;" width="427">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">对于非</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>Java</span><span style="">函数(</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>native methods</span><span style="">)不要生成用于非</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>Java</span><span style="">代码的Java接口(</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>JNI</span><span style="">)。</span></p>
</td>
</tr>
<tr style="">
<td style="background: #f0f0ff; width: 100.35pt; border: #ece9d8; padding: 3pt;" width="134">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">-resource:</span><em style=""><span style="">路径名</span></em></p>
</td>
<td style="background: #f0f0ff; width: 320.25pt; border: #ece9d8; padding: 3pt;" width="427">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">指定</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>Java</span><span style="">资源的引用路径名。</span></p>
</td>
</tr>
<tr style="">
<td style="background: #f0f0ff; width: 100.35pt; border: #ece9d8; padding: 3pt;" width="134">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>-exclude:</span><span style="">文件名</span></p>
</td>
<td style="background: #f0f0ff; width: 320.25pt; border: #ece9d8; padding: 3pt;" width="427">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">要排除的类名列表。</span></p>
</td>
</tr>
<tr style="">
<td style="background: #f0f0ff; width: 100.35pt; border: #ece9d8; padding: 3pt;" width="134">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>-debug</span></p>
</td>
<td style="background: #f0f0ff; width: 320.25pt; border: #ece9d8; padding: 3pt;" width="427">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">将调试信息输出。注意:只有当</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>.class</span><span style="">文件含有调试信息(即使用</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>javac-g</span><span style="">参数编译)时才有用。</span><span style=""> </span></p>
</td>
</tr>
<tr style="">
<td style="background: #f0f0ff; width: 100.35pt; border: #ece9d8; padding: 3pt;" width="134">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">-srcpath:</span><em style=""><span style="">路径</span></em></p>
</td>
<td style="background: #f0f0ff; width: 320.25pt; border: #ece9d8; padding: 3pt;" width="427">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">指定源代码的位置。与</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>-debug</span><span style="">同时使用。程序会将包中类的搜索路径指定为此路径,并从中搜索类的源代码。</span><span style=""> </span></p>
</td>
</tr>
<tr style="">
<td style="background: #f0f0ff; width: 100.35pt; border: #ece9d8; padding: 3pt;" width="134">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">-Xtrace:</span><em style=""><span style="">名称</span></em><span style=""> </span></p>
</td>
<td style="background: #f0f0ff; width: 320.25pt; border: #ece9d8; padding: 3pt;" width="427">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">显示所有该指定名称的跟踪点。</span></p>
</td>
</tr>
<tr style="">
<td style="background: #f0f0ff; width: 100.35pt; border: #ece9d8; padding: 3pt;" width="134">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">-Xmethodtrace:</span><em style=""><span style="">函数名</span></em><span style=""> </span></p>
</td>
<td style="background: #f0f0ff; width: 320.25pt; border: #ece9d8; padding: 3pt;" width="427">
<p class="MsoNormal" style="background: #7099c5; margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">指定的生成的函数名,将函数跟踪器(</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>method trace</span><span style="">)生成到此函数中。</span><span style=""> </span></p>
</td>
</tr>
</tbody></table>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><a name="N1016E"><strong style=""><span style="">几点说明</span></strong></a><span style=""><strong style=""></strong></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>ikvmc</span><span style="">利用</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>Java</span><span style="">类文件和包文件生成</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>.NET</span><span style="">程序集。它将输入文件中的</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>Java</span><span style="">二进行代码转化成</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>.NET</span><span style="">公共中间语言(</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>CIL</span><span style="">)。并利用它来生成:</span></p>
<ul type="disc">
<li class="MsoNormal" style="margin: 0cm 0cm 0pt; color: black; text-align: left;">
<span style='font-size: 11pt; font-family: "Times New Roman","serif";'>.NET</span><span style="">可执行文件(</span><span style='font-size: 11pt; font-family: "Times New Roman","serif";'>-target:exe or –target:winexe</span><span style="">)</span>
</li>
<li class="MsoNormal" style="margin: 0cm 0cm 0pt; color: black; text-align: left;">
<span style='font-size: 11pt; font-family: "Times New Roman","serif";'>.NET</span><span style="">类库(</span><span style='font-size: 11pt; font-family: "Times New Roman","serif";'>-target:library</span><span style="">)</span>
</li>
<li class="MsoNormal" style="margin: 0cm 0cm 0pt; color: black; text-align: left;">
<span style='font-size: 11pt; font-family: "Times New Roman","serif";'>.NET</span><span style="">模块(</span><span style='font-size: 11pt; font-family: "Times New Roman","serif";'>-target:module</span><span style="">)</span>
</li>
</ul>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>Java</span><span style="">程序一般由一系列的包文件组成。</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>ikvmc</span><span style="">可以将多个包文件(和类文件)转化成一个单独的</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>.NET</span><span style="">可执行程序或类库文件。例如,一个程序包含</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>main.jar</span><span style="">、</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>lib1.jar</span><span style="">和</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>lib2.jar</span><span style="">可以转化成一个单独的</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>main.exe</span><span style="">文件。</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">处理多个包文件时,如果有多个相同的类或源文件,</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>ikvmc</span><span style="">会使用第一个读入的版本,而忽略以后读到的。这时会产生警告信息。因此,包文件的顺序至关重要。</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">注意:</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><a name="N1018D"><span style="">为了得到最佳结果,使用</span></a><span style=""><span style='font-size: 9pt; color: black; font-family: "Times New Roman","serif";'>ikvmc</span></span><span style=""><span style="">转换</span></span><span style=""><span style='font-size: 9pt; color: black; font-family: "Times New Roman","serif";'>Java</span></span><span style=""><span style="">程序时,请按照</span></span><span style=""><span style='font-size: 9pt; color: black; font-family: "Times New Roman","serif";'>Java</span></span><span style=""><span style="">程序中类路径的顺序在,把要转换包的列表键入</span></span><span style=""><span style='font-size: 9pt; color: black; font-family: "Times New Roman","serif";'>ikvmc</span></span><span style=""><span style="">的命令行。</span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><strong style=""><span style="">示例</span></strong><strong style=""></strong></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style='font-size: 11pt; color: black; font-family: "Courier New";'>ikvmc myProg.jar </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="" lang="EN-US"><span style=""></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">程序会自动在</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>myprog.jar</span><span style="">中查找</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>main</span><span style="">函数。如果找到了</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>main</span><span style="">函数,那么生成一个</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>.exe</span><span style="">文件;否则,生成一个</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>.dll</span><span style="">文件。</span><span style=""> </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style='font-size: 11pt; color: black; font-family: "Courier New";'>ikvmc -out:myapp.exe -main:org.anywhere.Main -recurse:bin\*.class lib\mylib.jar</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="" lang="EN-US"><span style=""></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="">处理</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>bin</span><span style="">文件夹中所有的</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>.class</span><span style="">文件以及</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>lib</span><span style="">文件夹中的</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>mylib.jar</span><span style="">文件。生成一个名为</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>myapp.exe</span><span style="">的可执行文件,并把</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>org.anywhere.Main</span><span style="">作为</span><span style='font-size: 11pt; color: black; font-family: "Times New Roman","serif";'>main</span><span style="">函数。</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span style="" lang="EN-US"><span style="font-size: small; font-family: Calibri;"></span></span></p>