Java on .NET
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!
1 comment April 18th, 2006 matthias