We reduce and optimize the times of our activities

How to use JTOpen in .Net environment to develop client IBM i in Microsoft C# programming language

What is JTOpen? It is the Open Source version of the IBM Toolbox for Java, a series of Java classes which allow to easily connect to IBM i systems from Java development environments in the simple client/server model (where the client can be the web with servlets, a desktop app written in Java, the applets, etc…). With JTOpen you can manage the AS/400 data and resources without the need to have other installed softwares.

But what if our skills, or the company directives, are not oriented to Java but to Microsoft’s .NET environments?
No worries, we can transform the JTOpen classes into dlls and use them within our C# or VB.NET programs.

In this step it helps us another open source project, IKVM.NET, which is a JVM that allows to run Java classes within .Net but it also allows to convert the Java jars packages into dlls, we will follow the approach of conversion from jars to dlls.

Let’s take a look at all step by step

  • Download the jars of JTOpen: JTOpen
  • Search for the latest version (currently there is the 10.6) and download the relative .zip (currently jtopen_10_6.zip)
  • Unzip the zip in a local folder on our PC getting the folder \lib containing all JTOpen’s .jar.
  • Download the project IKVM.NET: IKVM.NET
  • Search for the latest version (currently there is the 7.2.4630.5) and download the relative .zip with compiled (currently ikvmbin-7.2.4630.5.zip)
  • Let’s convert the jar into dll running running the following command from a DOS shell opened in administrator (obviously with the right PATH depending on where we have saved the unzipped):

  • .\ikvm-7.2.4630.5\bin\ikvmc.exe -target:library \JTOpen\jtopen_10_6\lib\jt400.jar

    We obtain the jt400.dll file which we will be able to use in our .NET projects linking the references to this dll and to the necessary IKVM ones.

    ...but all of this will be part of a next article… 😉

    Marco Moret Monitoring Project Manager at smeup ICS
    Alessandro Saviolo Monitoring Developer and Help Desk at smeup ICS
     You can also find the article on LinkedIn

    All articles
     Writers Manager: Monitor and manage printers with SQL
     Checking security on IBM i systems: the Audit Journal
     The first JDBC connection from C# to IBM i
     JTOpen for .Net environment: programming application in C# for IBM i
     DB2 for i: manage dates in SQL
     Get system info in SQL

    Manage, analyze and control your Systems IBM i
    Download, install and use in seconds
      IBM i Monitoring Facility - Check is completely free until the end of the month