您的位置:首页 > 其它

IKVM.NET_第五篇_用户指南_安装

2010-07-04 15:50 375 查看
本文内容如下:
1) 安装
2) 配置开发
+++ 安装
在Windows和Linux上的安装过程都很简单。下载IKVM.NET的可执行程序,在Windows命令行模式直接执行即可,此时你将看到ikvm的命令提示:
usage: ikvm [-options] [args...]
(to execute a class)
or ikvm -jar [-options] [args...]
(to execute a jar file)
为了方便,你可以把***/ikvm/bin路径添加到操作系统的环境变量PATH中。这样,你就可以把ikvm当作Java虚拟机,而无需进一步配置。如果你想使用.NET / Mono的IKVM开发,下面介绍如何进行配置。
+++ 配置开发
如果你想用IKVM.NET来进行.NET开发,你需要进行以下步骤:
1) 下载Java SDK
如果你想用Java写代码,运行在.NET中,那么,你需要Java编译器(任何Java编译器),把Java代码编译成.class文件(字节码)。IKVM.NET不带Java编译器;
2) 在Windows的全局装配缓存区(Global Assembly Cache,GAC)安装IKVM dll文件。
当使用IKVM dll文件运行.NET应用程序时,.NET框架必须能找到这些DLL文件,它要么在全局装配缓存区中,要么在当前目录中。可以在Windows控制面板->管理工具中的.NET 框架配置项中将IKVM dll文件添加到全局装配缓存区。最低限度需要添加“IKVM.OpenJDK.ClassLibrary.dll”和“IKVM.Runtime.dll”。

IKVM.NET Installation
1) Installation
2) Configuration for Development
+++ Installation
++ The installation procedure for both Windows and Linux is straightforward. After downloading the binary distribution, simply extract the files from the archive. Open a command or shell window, cd to ikvm/bin, and type
ikvm If your system is operating correctly, you should see the following output:
usage: ikvm [-options] [args...]
(to execute a class)
or ikvm -jar [-options] [args...]
(to execute a jar file)
++ For convenience, you may wish to add the /ikvm/bin folder to your system's path, but this is not required. Now, if all you want to do is use IKVM as a Java VM, you're done -- no further configuration is needed. If you want to use IKVM for .NET / Mono development, read the configuration instructions below.
+++ Configuration for Development
If you plan to do .NET development with IKVM.NET, you may wish to do the following:
1) Download a Java SDK
If you plan to develop code in Java that runs in .NET, you will need a Java compiler. IKVM.NET does not come with a compiler. You may use any Java compiler that emits standard Java .class files.
2) Windows: Install IKVM dll's in the Global Assembly Cache
When running .NET applications in Windows that use IKVM dll's, the .NET framework must be able to locate the dll's. It looks in the Global Assembly Cache, then in the current directory. If you want to be able to do development without having the dll's in the current directory, you must install them in the Global Assembly Cache. To do this in Windows, access the Microsoft .NET Framework Configuration item in the Windows Control Panel, and add the assemblies to the Assembly Cache. At a minimum, you will want to install the IKVM.OpenJDK.ClassLibrary.dll and IKVM.Runtime.dll.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: