Java on .NET

April 18th, 2006 matthias

Prompted by Tony, I have played with ikvm, which allows you to run Java programs on .NET. Significantly it facilitates mixing and interop between Java and .NET code, i.e. Java code can call .NET libraries and .NET code can call Java libraries.

As a test, I tried running SISC under ikvm. Amazingly, “it just works”. Even calls to .NET libraries via SISC’s reflection-based Java interop interface work as expected:

C:\programs\sisc-1.13.4\sisc-1.13.4>set java=c:\programs\ikvmbin-0.26.0.1\ikvm-0.26.0.1\bin\ikvm
C:\programs\sisc-1.13.4\sisc-1.13.4>sisc.bat
SISC (1.13.4)
#;> (import s2j)
#;> (define-java-class <java.lang.System>)
#;> (define-generic-java-method println)
#;> (define-generic-java-field-accessor :out)
#;> (println (:out (java-null <java.lang.System>)) (->jstring "Hello, world"))
Hello, world
#<jnull void>
#;> (define-java-class <cli.system.console> |cli.System.Console|)
#;> (define-generic-java-method write-line |WriteLine|)
#;> (write-line (java-null <cli.system.console>) (->jstring "Hello, world"))
Hello, world
#<jnull void>
#;>

There are reports that people have managed to run tomcat on .NET this way!

Entry Filed under: Technology

1 Comment Add your own

  • 1. Chris Double  |  April 18th, 2006 at 12:36 pm

    ikvm is definitely cool. I’ve run Jetty (another Java webserver) and ran our continuation based web server written in Sisc using it under .NET and mono on Linux.

    I was pleasantly surprised to see it work. The whole setup used Jetty, HSQLDB (a java DB), various XSLT and XML transformers and custom Java libraries as well as Sisc. Pretty amazing.

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed

Calendar

April 2006
M T W T F S S
« Mar   May »
 12
3456789
10111213141516
17181920212223
24252627282930

Most Recent Posts