<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Tutorial</title><link>https://sourceforge.net/p/ikvm/wiki/Tutorial/</link><description>Recent changes to Tutorial</description><atom:link href="https://sourceforge.net/p/ikvm/wiki/Tutorial/feed" rel="self"/><language>en</language><lastBuildDate>Sun, 29 Jun 2014 06:24:30 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/ikvm/wiki/Tutorial/feed" rel="self" type="application/rss+xml"/><item><title>Tutorial modified by Small SQL</title><link>https://sourceforge.net/p/ikvm/wiki/Tutorial/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v6
+++ v7
@@ -26,7 +26,7 @@
 If you experience problems, check the following:

   * Check your capitalization: ikvm, like java, requires you to capitalize class names correctly. 
-  * If ikvm reports a ClassNotFoundException, check whether the CLASSPATH environment variable is set. If so, try clearing the CLASSPATH or adding the current directory to it so ikvm can find the class in the current directory. 
+  * If ikvm reports a [ClassNotFoundException], check whether the CLASSPATH environment variable is set. If so, try clearing the CLASSPATH or adding the current directory to it so ikvm can find the class in the current directory. 

 You can also execute Java applications in a jar file. Try it out: 

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Small SQL</dc:creator><pubDate>Sun, 29 Jun 2014 06:24:30 -0000</pubDate><guid>https://sourceforge.neta61072787c03f7abcbd2a8ea5da371971efa6a15</guid></item><item><title>Tutorial modified by Small SQL</title><link>https://sourceforge.net/p/ikvm/wiki/Tutorial/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v5
+++ v6
@@ -106,3 +106,5 @@

 After the command completes, you should find ShowDir.exe in the current directory. You should be able to execute it successfully. (On Windows .NET, remember to copy the IKVM dll's to the current directory.) 
+
+See for [Ikvmc] and [ClassLoader] for more details. 
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Small SQL</dc:creator><pubDate>Sun, 29 Jun 2014 06:24:30 -0000</pubDate><guid>https://sourceforge.net2368e8f1a00a2d2ebc5d36e3d8a1c3336bc571f1</guid></item><item><title>Tutorial modified by Jeroen Frijters</title><link>https://sourceforge.net/p/ikvm/wiki/Tutorial/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v4
+++ v5
@@ -102,7 +102,7 @@

 Now, we'll convert the Java class file to a .NET application. Type the following: 

-    ikvmc ShowDir.class
+    ikvmc -r:mscorlib.dll ShowDir.class

 After the command completes, you should find ShowDir.exe in the current directory. You should be able to execute it successfully. (On Windows .NET, remember to copy the IKVM dll's to the current directory.) 
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jeroen Frijters</dc:creator><pubDate>Sun, 29 Jun 2014 06:24:30 -0000</pubDate><guid>https://sourceforge.net7b4dc9505b575feaaae1199d36a70cd421b691ac</guid></item><item><title>Tutorial modified by Small SQL</title><link>https://sourceforge.net/p/ikvm/wiki/Tutorial/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v3
+++ v4
@@ -57,9 +57,22 @@

 ## Develop a .NET Application in Java

-In this section, you will learn the steps needed to develop .NET applications in Java. 
+In this section, you will learn the steps needed to develop .NET applications in Java. Take a look at the source code of ShowDir.java -- this is a Java application that uses the .NET API to display a list of files in the current directory. 
+    
+    import cli.System.IO.*;
+    
+    public class ShowDir{
+    
+       public static void main(String[] args){
+           String[] files = Directory.GetFiles(".");
+           for(String file : files){
+               System.out.println(file);
+           }
+       }
+    }
+    

-To begin, open a command window and navigate to IKVMROOT\samples\usenetapi. Take a look at ShowDir.java -- this is a Java application that uses the .NET API to display a list of files in the current directory. Notice the imports at the top -- the package names begin with cli.*. These are not packages in the Java API; rather, they are "pseudo" packages that map to .NET namespaces. For more information on this, see the Developer's Guide. 
+Notice the imports at the top -- the package names begin with cli.*. These are not packages in the Java API; rather, they are "pseudo" packages that map to .NET namespaces. For more information on this, see the Developer's Guide. 

 ### Step 1: Generate Java stubs

@@ -81,7 +94,7 @@
     javac -classpath mscorlib.jar ShowDir.java

-(Substitute jikes for javac if you're using that tool.) 
+(Substitute jikes for javac if you're using that tool.) Of course you can also use any Java IDE like Eclipse. 

 After the command completes, you should find ShowDir.class in the current directory. 

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Small SQL</dc:creator><pubDate>Sun, 29 Jun 2014 06:24:30 -0000</pubDate><guid>https://sourceforge.net51bc0234146c5eed8b2ed0bb1f0e4a2b17dfd844</guid></item><item><title>Tutorial modified by Small SQL</title><link>https://sourceforge.net/p/ikvm/wiki/Tutorial/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -63,7 +63,7 @@

 ### Step 1: Generate Java stubs

-IKVM does not come with a Java compiler, so we will compile ShowDir using a standard Java compiler. Since Java compilers can only compile applications that use Java API's, not .NET API's, we have to fool the Java compiler into believing that there is really a Java package named cli.System.IO. The ikvmstub application helps us do this. It generates Java jar files from .NET dll's. The jar files generated by ikvmstub contain Java classes and interfaces that correspond to .NET classes, but don't contain any real code. They contain just enough to satisfy the Java compiler, and allow it to type check the Java application. 
+IKVM does not come with a Java compiler, so we will compile ShowDir using a standard Java compiler. Since Java compilers can only compile applications that use Java API's, not .NET API's, we have to fool the Java compiler into believing that there is really a Java package named cli.System.IO. The [Ikvmstub] application helps us do this. It generates Java jar files from .NET dll's. The jar files generated by [Ikvmstub] contain Java classes and interfaces that correspond to .NET classes, but don't contain any real code. They contain just enough to satisfy the Java compiler, and allow it to type check the Java application. 

 Type the following: 

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Small SQL</dc:creator><pubDate>Sun, 29 Jun 2014 06:24:30 -0000</pubDate><guid>https://sourceforge.netd65518398cb7844f17a60dd7baf7817bf71ef37f</guid></item><item><title>Tutorial modified by Small SQL</title><link>https://sourceforge.net/p/ikvm/wiki/Tutorial/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -1,3 +1,5 @@
+{{UserGuide}} 
+
 [TOC]

 ## Setup your Environment
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Small SQL</dc:creator><pubDate>Sun, 29 Jun 2014 06:24:30 -0000</pubDate><guid>https://sourceforge.net1434751541a1224c95ac94255d40c41074c42935</guid></item><item><title>Tutorial modified by Small SQL</title><link>https://sourceforge.net/p/ikvm/wiki/Tutorial/</link><description>&lt;div class="markdown_content"&gt;&lt;div class="toc"&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#setup-your-environment"&gt;Setup your Environment&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#run-a-java-application-dynamically"&gt;Run a Java Application Dynamically&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#convert-a-java-application-to-net"&gt;Convert a Java Application to .NET&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#develop-a-net-application-in-java"&gt;Develop a .NET Application in Java&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#step-1-generate-java-stubs"&gt;Step 1: Generate Java stubs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#step-2-compile-the-java-source-code"&gt;Step 2: Compile the Java source code&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#step-3-generate-a-net-executable"&gt;Step 3: Generate a .NET executable&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;h2 id="setup-your-environment"&gt;Setup your Environment&lt;/h2&gt;
&lt;p&gt;This tutorial includes information for both the Windows and Linux platforms. It assumes that Windows users will be using the .NET SDK, and Linux users will be using the Mono SDK. &lt;/p&gt;
&lt;p&gt;This tutorial references files in the samples distribution available on the &lt;a class="alink" href="/p/ikvm/impwiki/Download/"&gt;[Download]&lt;/a&gt; page. Before you begin, prepare your environment by adding the following to your PATH environment variable: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The directory containing the IKVM executables &lt;/li&gt;
&lt;li&gt;The directory containing the C# compiler (Windows: csc / Mono: mcs). On Windows, this is typically C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322. &lt;/li&gt;
&lt;li&gt;The directory containing a Java compiler (javac or jikes) &lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="run-a-java-application-dynamically"&gt;Run a Java Application Dynamically&lt;/h2&gt;
&lt;p&gt;IKVM.NET includes a Java Virtual Machine implented in C#. To try it out, navigate to IKVMROOT\samples\hello and compile the sample application: javac Hello jar cfm hello.jar manifest.mf Hello.class &lt;/p&gt;
&lt;p&gt;Now, to run the application using the IKVM Virtual Machine, enter the following: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;ikvm&lt;/span&gt; &lt;span class="n"&gt;Hello&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This command starts the virtual machine, which searches for a file named Hello.class. When it finds it, it loads it and executes the bytecodes dynamically. You should be prompted to enter your name, and see a brief greeting. &lt;/p&gt;
&lt;p&gt;If you experience problems, check the following: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Check your capitalization: ikvm, like java, requires you to capitalize class names correctly. &lt;/li&gt;
&lt;li&gt;If ikvm reports a ClassNotFoundException, check whether the CLASSPATH environment variable is set. If so, try clearing the CLASSPATH or adding the current directory to it so ikvm can find the class in the current directory. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can also execute Java applications in a jar file. Try it out: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;ikvm&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;jar&lt;/span&gt; &lt;span class="n"&gt;hello&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;jar&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;See the &lt;a class="alink" href="/p/ikvm/impwiki/Ikvm/"&gt;[Ikvm]&lt;/a&gt; reference for more information about ikvm command line options. &lt;/p&gt;
&lt;h2 id="convert-a-java-application-to-net"&gt;Convert a Java Application to .NET&lt;/h2&gt;
&lt;p&gt;IKVM.NET includes &lt;a class="alink" href="/p/ikvm/impwiki/Ikvmc/"&gt;[Ikvmc]&lt;/a&gt;, a utility that converts Java .jar files to .NET .dll libraries and .exe applications. In this section, you'll convert a Java application to a .NET .exe. &lt;/p&gt;
&lt;p&gt;Navigate to IKVMROOT\samples\hello and enter the following: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;ikvmc&lt;/span&gt; &lt;span class="n"&gt;hello&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;jar&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;After the command completes, you should find a hello.exe file in the current directory. To execute it: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Windows / .NET Framework: &lt;/li&gt;
&lt;li&gt;Try running hello.exe. If you get a FileNotFound exception when the .NET runtime attempts to load the referenced IKVM.OpenJDK.*.dll, remember that the .NET Framework expects to find referenced dll's in the application directory or in the Global Assembly Cache. Either install the dll's in the Global Assembly Cache, or copy them to the application directory. &lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Linux / Mono: &lt;/p&gt;
&lt;p&gt;Run it using the following command: &lt;/p&gt;
&lt;p&gt;mono hello.exe&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="develop-a-net-application-in-java"&gt;Develop a .NET Application in Java&lt;/h2&gt;
&lt;p&gt;In this section, you will learn the steps needed to develop .NET applications in Java. &lt;/p&gt;
&lt;p&gt;To begin, open a command window and navigate to IKVMROOT\samples\usenetapi. Take a look at ShowDir.java -- this is a Java application that uses the .NET API to display a list of files in the current directory. Notice the imports at the top -- the package names begin with cli.*. These are not packages in the Java API; rather, they are "pseudo" packages that map to .NET namespaces. For more information on this, see the Developer's Guide. &lt;/p&gt;
&lt;h3 id="step-1-generate-java-stubs"&gt;Step 1: Generate Java stubs&lt;/h3&gt;
&lt;p&gt;IKVM does not come with a Java compiler, so we will compile ShowDir using a standard Java compiler. Since Java compilers can only compile applications that use Java API's, not .NET API's, we have to fool the Java compiler into believing that there is really a Java package named cli.System.IO. The ikvmstub application helps us do this. It generates Java jar files from .NET dll's. The jar files generated by ikvmstub contain Java classes and interfaces that correspond to .NET classes, but don't contain any real code. They contain just enough to satisfy the Java compiler, and allow it to type check the Java application. &lt;/p&gt;
&lt;p&gt;Type the following: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;ikvmstub&lt;/span&gt; &lt;span class="n"&gt;mscorlib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dll&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Note: On a Linux Mono installation, you will have to type the full pathname to mscorlib.dll, like this: ikvmstub /usr/lib/mscorlib.dll &lt;/p&gt;
&lt;p&gt;After the command completes, you should find a file named mscorlib.jar in the current directory. &lt;/p&gt;
&lt;h3 id="step-2-compile-the-java-source-code"&gt;Step 2: Compile the Java source code&lt;/h3&gt;
&lt;p&gt;Now, we'll compile the Java source code. If you're using javac, type the following: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;javac&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;classpath&lt;/span&gt; &lt;span class="n"&gt;mscorlib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;jar&lt;/span&gt; &lt;span class="n"&gt;ShowDir&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;java&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;(Substitute jikes for javac if you're using that tool.) &lt;/p&gt;
&lt;p&gt;After the command completes, you should find ShowDir.class in the current directory. &lt;/p&gt;
&lt;h3 id="step-3-generate-a-net-executable"&gt;Step 3: Generate a .NET executable&lt;/h3&gt;
&lt;p&gt;Now, we'll convert the Java class file to a .NET application. Type the following: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;ikvmc&lt;/span&gt; &lt;span class="n"&gt;ShowDir&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;After the command completes, you should find ShowDir.exe in the current directory. You should be able to execute it successfully. (On Windows .NET, remember to copy the IKVM dll's to the current directory.) &lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Small SQL</dc:creator><pubDate>Sun, 29 Jun 2014 06:24:29 -0000</pubDate><guid>https://sourceforge.net3cd7d6f46e6a38151522ee8ff04e5b62504e637c</guid></item></channel></rss>